erosman / support

Support Location for all my extensions
Mozilla Public License 2.0
168 stars 12 forks source link

[Firemonkey] GM_getResourceText is undefined & `@require` doesn't work #609

Open ngdangtu-vn opened 10 months ago

ngdangtu-vn commented 10 months ago

Sample

// ==UserScript==
// @run-at       document-end
// @resource     style  https://gitlab.com/ndt-browserkit/userscript/-/raw/main/dynasty-scans.com/style/chapter.css
// @inject-into  page
// @grant        unsafeWindow
// @grant        GM_getResourceText
// ==/UserScript==

doc.head.innerHTML += `<style>${GM_getResourceText('style')}</style>`

Current specification:

Seems like the plugin couldn't download remote files because the @require doesn't work as well. You can test with my userscript: https://gitlab.com/ndt-browserkit/userscript/-/blob/5d7645d794442a4d9cb0cd00b9fec032281a0621/dynasty-scans.com/chapter.user.js

The script I add in here play very well with Violentmonkey 2.16.0 (it even support detect & installation for gitlab, Tampermonkey didn't do this)

erosman commented 10 months ago

I was away for a few days. I will check it.

erosman commented 9 months ago

// @inject-into page

In this case, script is injected into the page context and there is no GM API support (except for GM info).

See also: FireMonkey Help: inject-into