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

[Chrome] @grant not none causing page JS issues #498

Closed
Mottie opened this issue Jan 30, 2018 · 0 comments
Closed

[Chrome] @grant not none causing page JS issues #498

Mottie opened this issue Jan 30, 2018 · 0 comments

Comments

@Mottie
Copy link

Mottie commented Jan 30, 2018

The following conditions appear to cause an issue and somehow break JS code on a page:

  • Setting the @grant to anything other than none.
  • Accessing the document from within a userscript.
  • Strict CSP (e.g. GitHub)? Just guessing here...

Several issues were reported that GitHub repo project card drag and drop was no longer working with a userscript. No JS errors are seen.

After some investigation, I found that numerous userscripts were causing the problem. Eventually I found that this minimal userscript would break the project card drag and drop, but only in Chrome.

// ==UserScript==
// @name        test
// @version     1.0.0
// @include     https://github.com/*
// @grant       GM_addStyle
// ==/UserScript==
console.log(document.readyState);

Changing the @grant to none, or not accessing the document will not cause the aforementioned problem.

This issue appears to occur only in Chrome in both TM 4.5 and TM Beta 4.6.5694. Firefox does not have this issue. I did not test other browsers or older versions of TM.

I've tried to investigate the cause, but GitHub has three minified JS files which are difficult to navigate.

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

2 participants