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
The current method of running frame scripts has several problems:
window.postMessage can be picked up by scripts in the page (which is currently used to prevent the frame script from injecting twice into the page due to the way chrome.tabs.executeScript is run)
There's no way to get the mode without making additional asynchronous calls. It's important for the frame script to know the mode on initialization so it can know whether to stop autobuffering or not.
I've come up with three solutions that make use of content scripts declared in the manifest:
Send a message to the background page and run the sendResponse method (which I think runs synchronously) with the mode as an argument (or don't run it at all if the mode is "nothing".)
Run chrome.tabs.getCurrent and chrome.runtime.getBackgroundScript at the same time in the content script, and have both callbacks attempt to run a function in the background script to get the mode (based on the tab id.)
Have chrome.tabs.executeScript set a variable that the content script defined in the manifest file can read.
The question is, which method is fastest? Is there a faster method not listed above?
The text was updated successfully, but these errors were encountered:
The current method of running frame scripts has several problems:
I've come up with three solutions that make use of content scripts declared in the manifest:
The question is, which method is fastest? Is there a faster method not listed above?
The text was updated successfully, but these errors were encountered: