hope allow @require url support Data URLs
lisonge opened this issue · 9 comments
lisonge commented
// ==UserScript==
// @name example
// @namespace https://github.com/lisonge
// @version 1.0.1
// @author lisonge
// @match https://i.songe.li/
// @require https://cdn.jsdelivr.net/npm/vue@3.0.0/dist/vue.global.prod.js
// @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
// @require https://unpkg.com/element-plus@2.2.15/dist/index.full.js
// ==/UserScript==
// `data:application/javascript,` + encodeURIComponent(`;window.Vue=Vue;`)
because vue
use iife export, element-plus
use umd, they can not both work in Tampermonkey/Violentmonkey window scope
full detail see vite-plugin-monkey#5
The simplest solution is that add a @require url
to set window.Vue to scope.Vue after vue require url
JasonBarnabe commented
I don't understand the purpose of this. Can you explain further? Is this something already supported by user script managers like Tampermonkey?
lisonge commented
Tampermonkey/Violentmonkey support // @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
lisonge commented
lisonge commented
lisonge commented
lisonge commented
Do you understand what I mean ?
lisonge commented
@JasonBarnabe hello, Could you please give me an accurate reply?
JasonBarnabe commented
data URI @require
s are now allowed.
lisonge commented
ok, thanks