qinxs / Ease-Bookmarks

简单易用的书签管理器
MIT License
158 stars 10 forks source link

Manifest V3 不支持动态js代码 #4

Open qinxs opened 2 years ago

qinxs commented 2 years ago

js小书签,需要用到此功能

V2的 APIchrome.tabs.executeScript,支持 V3的 APIchrome.scripting.executeScript(),明显不支持

Manifest V3 migration checklist 里说到:

Are you executing remote code or arbitrary strings? You can no longer execute external logic using chrome.scripting.executeScript({code: '...'}), eval(), and new Function().

Move all external code (JS, Wasm, CSS) into your extension bundle. Update script and style references to load resources from the extension bundle. Use chrome.runtime.getURL() to build resource URLs at runtime.

另外,Tampermonkey 的 issue #644 中也说明了还不支持

qinxs commented 4 months ago

userScripts API https://developer.chrome.com/docs/extensions/reference/api/userScripts?hl=zh-cn

要求:

qinxs commented 2 months ago

目前仍不支持js小书签 js代码不能立即运行 https://github.com/w3c/webextensions/blob/main/proposals/user-scripts-execute-api.md