Skip to content

ProxyContext 問題記錄及整理 #522

@cyfung1031

Description

@cyfung1031

以下只是用來記一下。等一下提PR再關掉這個

  1. 好像一定要 .call(this, 。 arrow function 的this也是會被改。不清楚是不是因為用了 with(this) 導致
  2. 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 問題?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions