Last active
November 7, 2023 00:47
-
-
Save arantius/e50990f74376f4ed906243af392d6038 to your computer and use it in GitHub Desktop.
Test script with a CSS resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name CSS Resource Test | |
// @version 1 | |
// @grant GM.getResourceUrl | |
// @resource css test.css | |
// ==/UserScript== | |
(async function() { | |
var link = document.createElement('link'); | |
link.rel = 'stylesheet'; | |
link.type = 'text/css'; | |
link.href = await GM.getResourceUrl('css', 'text/css'); | |
link.media = 'all'; | |
(document.head || document.body).appendChild(link); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { outline: 1px dashed red; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ooof.
This depends on the page! On some pages it works, on some pages they do something to make this strict.