-
Notifications
You must be signed in to change notification settings - Fork 324
ProxyContext 問題記錄及整理 #522
Copy link
Copy link
Closed as not planned
Description
以下只是用來記一下。等一下提PR再關掉這個
- 好像一定要
.call(this,。 arrow function 的this也是會被改。不清楚是不是因為用了with(this)導致 - TM也存在以下問題
先看看 grant unsafeWindow 后 window scope 问题 #273
即使用上了@sandbox JavaScript
也是能改掉頁面JS物件
// ==UserScript==
// @name New Userscript
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @match https://quilljs.com/playground/snow
// @grant GM_setValue
// @inject-into content
// @sandbox JavaScript
// ==/UserScript==
(function() {
console.log(window === unsafeWindow);
console.log("window", "------", window.Quill)
// console.log("unsafeWindow", "------", unsafeWindow.Quill)
// Your code here...
delete Quill
console.log(window === unsafeWindow);
console.log("window", "------", window.Quill)
// console.log("unsafeWindow", "------", unsafeWindow.Quill)
})();打印了兩個undefined是沒問題
但頁面Quill 也被刪了
這個跟Violentmonkey不一樣。 Violentmonkey的// @inject-into content真正隔開了page和content
(還是說這個是MV3的userScript API 問題?)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels