Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greaselion script doesn't run when browser is launched with open tabs #11825

Open
emerick opened this issue Sep 23, 2020 · 3 comments
Open

Greaselion script doesn't run when browser is launched with open tabs #11825

emerick opened this issue Sep 23, 2020 · 3 comments

Comments

@emerick
Copy link
Contributor

emerick commented Sep 23, 2020

Create a Greaselion.json file like the following and a simple script that just prints Hello, world! to the console:

  {
    "urls": [
      "https://twitter.com/*",
      "https://*.twitter.com/*"
    ],
    "scripts": [
      "myscript.js"
    ]
  }

If you launch the browser clean (with no open pages) and then navigate to https://twitter.com/emerick, it will correctly run the content script and display Hello, world! on the console.

If you close the browser and relaunch it (such that it now opens https://twitter.com/emerick automatically on startup), the content script will not run and nothing will be shown on the console. If you refresh the page, the content script will finally load and run as expected.

@emerick
Copy link
Contributor Author

emerick commented Sep 16, 2021

Note: This only happens for the active tab, not all tabs.

@emerick
Copy link
Contributor Author

emerick commented Sep 20, 2021

Might need to rethink our approach here, based on comments in other issues like these:

https://bugs.chromium.org/p/chromium/issues/detail?id=70256#c4
https://bugs.chromium.org/p/chromium/issues/detail?id=708354#c7

Those comments imply that extensions must be fully loaded before attempting any page loads.

@Miyayes
Copy link
Collaborator

Miyayes commented Dec 3, 2021

Workaround: You can refresh the page and it should work. (Please give a few seconds for the Tip buttons to show up.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants