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 Mar 16, 2024. It is now read-only.
Nothing fancy, then in the mouse gesture script I try to read the value :
constselection=window._previousSelection
No luck... Now I believe it's because your extension is executing the script in its own world and can't access page window user defined properties.
What can I do?
Note: Maybe we could implement a placeholder for that (%s). I know you are already providing this placeholder for search text actions.
Another solution is to just run the script into the MAIN world.
I tried to check the option Inject JQ because I thought that's what it was, but still not working.
(I could open a PR if you show me what part in your code is responsible for executing a script)
The text was updated successfully, but these errors were encountered:
The bad news is your extension is using manifest v2 (v3 is the new norm), therefore AFAIK it's not possible to have access to the main world objects properties.
In manifest v3 we could do:
chrome.scripting.executeScript({target: { tabId },func: ... // `code` in v2world: 'MAIN'}
Do you think it would be difficult to migrate your code to v3 ?
Great extension!
Nonetheless I am facing an issue, I try to execute a script but this script needs to get the selection in the page,
Of course this fails because when I am initiating a mouse gesture the text is deselected before the script runs, nothing surprising here.
My solution was to inject a piece of code in every page and will save the selected text on the
window
object.Nothing fancy, then in the mouse gesture script I try to read the value :
No luck... Now I believe it's because your extension is executing the script in its own world and can't access page
window
user defined properties.What can I do?
Note: Maybe we could implement a placeholder for that (
%s
). I know you are already providing this placeholder forsearch text
actions.Another solution is to just run the script into the
MAIN
world.I tried to check the option
Inject JQ
because I thought that's what it was, but still not working.(I could open a PR if you show me what part in your code is responsible for executing a script)
The text was updated successfully, but these errors were encountered: