Skip to content

[BUG] 沙盒环境全局变量拦截问题 #700

@DreamNya

Description

@DreamNya

问题描述

沙盒环境访问全局变量会被拦截到HTML同id元素上
相同代码油猴没这个问题

重现步骤

Image

具体代码详见补充信息

脚本猫版本

v1.0.2

操作系统以及浏览器信息

Edge v139

补充信息 (选填)

// ==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://pokeclicker.g8hh.com.cn/
// @grant        unsafeWindow
// ==/UserScript==

/* global pokemonList */

unsafeWindow.test = function () {
    console.log(window.pokemonList)
    console.log(unsafeWindow.pokemonList)
    console.log(pokemonList)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions