Redirect to another tab, without opening new tab

96 views
Skip to first unread message

Sam Paul

unread,
Aug 10, 2015, 2:51:30 PM8/10/15
to Chromium-extensions
I'm creating an extension that performs an action when a certain URL is clicked, redirected, or entered via Address Bar, but I want the extension to appear smooth by not having the tab appear at all. 

I am using:
chrome.webRequest.onBeforeRequest.addListener(functionToCall,
{urls: ['*://*.targetHost.com/*'], types: ["main_frame"]});

// Within functionToCall, I call removeTab, and focus on the tab I want to bring up.

but these methods briefly open a new tab before closing it and redirecting to an existing tab.

Is there any way to redirect/bypass the brief tab opening?  It causes the browser to jump around tabs and does not look smooth.

Thanks in advance!

PhistucK

unread,
Aug 11, 2015, 2:19:15 AM8/11/15
to Sam Paul, Chromium-extensions
Perhaps you need the webNavigation API, perhaps in conjunction with the tabs API (onCreated).
Regarding the redirection and the address bar cases, you cannot avoid a new tab for a brief moment, since the tab is opened before the redirection happens.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/8e8070ee-5f4c-4ebf-8171-11fe9ad114d0%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages