Could't use @require resource in devtool when @grant is't none
See original GitHub issue// @name Test
// @namespace test
// @match *://*/*
// @grant GM_addStyle
// @require https://unpkg.com/jquery
// @run-at document-start
// @version 1.0
// @author -
when set @grant GM_addStyle, jQuery couldn’t use in the script. it works while @grant is none.
How to reproduce it?
- set @grant GM_addStyle
- use $ or jQuery in chrome devtool for debug
- jQuery is not defined
What is the expected result?
Could use jquery in the devtool.
What is the actual result?
jQuery is not defined.
What is the result in the upcoming release?
Environment
- Browser:
- Browser version:
- Violentmonkey version:
- OS:
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
This userscript won't use the page's jQuery anymore ... - GitHub
This userscript won't use the page's jQuery anymore (even though there's '@grant none') and one of the @require rule (tablesorter) doesn't work either...
Read more >Can't find javascript source map to debug in chrome devtools
When I open up resources.entry.js in the chrome debugger, I see the following. source map detected. However, I can't seem to actually find...
Read more >react-devtools | Yarn - Package Manager
This package can be used to debug non-browser-based React applications (e.g. React Native, mobile browser or embedded webview, Safari). React DevTools ...
Read more >The specified module 'Module Name' was not loaded because ...
Problem: When trying to import the PnP PowerShell module, I got an error message “Import-Module: The specified module 'SharePointPnPPowerShellOnline' was ...
Read more >Azure Identity SDK (JS) How to Authenticate to User's Azure ...
I am not trying to grant users access to my app, but access to their own Azure account. Is InteractiveBrowserCredential what I should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is how userscripts work. Their
windowand global variables are sandboxed when@grantis notnone.@tophf I’m testing in chrome, it not works. Maybe many sites have been used jQuery. I am used d3 do testing replace jQuery to avoid confusion.