You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
How to open a new tab from a popup window and then focus on that one, so the content script could inject and exchange messages with background script?
Recently, a crash with opening link in the popup was fixed, however it seems that content script is not injected into the opened window from the popup link.
I've tried several solutions:
Prevent default link opening and use chrome.tabs.create({ url: 'desired url', active: true }); instead. It opens a new tab but doesn't focus on it.
Initially open a popup with chrome.tabs.create, so after that links will be opened in a new a tab and focused, but an extension also need to get a current opened tab link on button tapping in popup, because currently opened tab is popup window it will get popup link which not what we want.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
How to open a new tab from a popup window and then focus on that one, so the content script could inject and exchange messages with background script?
Recently, a crash with opening link in the popup was fixed, however it seems that content script is not injected into the opened window from the popup link.
I've tried several solutions:
chrome.tabs.create({ url: 'desired url', active: true });
instead. It opens a new tab but doesn't focus on it.chrome.tabs.create
, so after that links will be opened in a new a tab and focused, but an extension also need to get a current opened tab link on button tapping in popup, because currently opened tab is popup window it will get popup link which not what we want.Extension I'm working on: SyncWatch
Beta Was this translation helpful? Give feedback.
All reactions