Giter Club home page Giter Club logo

Comments (5)

itorr avatar itorr commented on June 10, 2024 3

按照 暴力猴的文档 https://violentmonkey.github.io/api/metadata-block/#inject-into 添加了

// @inject-into  content

可以尝试重新安装下脚本 https://lab.magiconch.com/nbnhhsh/nbnhhsh.user.js 确认问题有没有解决

from nbnhhsh.

itorr avatar itorr commented on June 10, 2024 1

装了暴力猴试了一下确实重现了这个问题,导致这个问题的原因是因为 暴力猴没有对 @require 的脚本注册的变量做作用域限定😔

最小问题重现是这样。

// ==UserScript==
// @name        New script - bilibili.com
// @namespace   Violentmonkey Scripts
// @match       https://www.bilibili.com/video/BV1nW4y1V7kR/
// @grant       none
// @version     1.0
// @require      https://lab.magiconch.com/vue.2.6.11.min.js
// ==/UserScript==

实测我甚至只要写个这样的脚本就能干掉所有需要全局调用 Vue 变量的网站😨

// ==UserScript==
// @name        New script - bilibili.com
// @namespace   Violentmonkey Scripts
// @match       https://www.bilibili.com/video/BV1nW4y1V7kR/
// @grant       none
// @version     1.0
// @author      -
// @description 2023/1/10 22:50:57
// ==/UserScript==
window.Vue = 1;

想要解决这个问题可能需要调整脚本的 Vue 引入方式,当前脚本被引用的地方有写多,我要考虑下怎么调整。

临时解决方案,可以选关闭本脚本、使用线上网站,或者建议使用 Tampermonkey 对用户脚本进行管理😡

from nbnhhsh.

Sabiary avatar Sabiary commented on June 10, 2024

浏览器:Microsoft Edge 版本 108.0.1462.76
脚本管理器:暴力猴 版本2.13.7
遇到一样的问题

from nbnhhsh.

WorldlineChanger avatar WorldlineChanger commented on June 10, 2024

cool,解决了

from nbnhhsh.

Sabiary avatar Sabiary commented on June 10, 2024

https://microsoftedge.microsoft.com/addons/detail/scriptcat/liilgpjgabokdklappibcjfablkpcekh
使用ScriptCat,也复现了这个问题

from nbnhhsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.