Skip to content

@require 引入依赖后出错 #260

Description

@shiquda

在Tampermonkey里面脚本是可以正常运行的,但是使用scriptcat的时候报错。

经过测试,引入 https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js 的时候导致出错。

测试样例:

// ==UserScript==
// @name         jq test
// @namespace    http://tampermonkey.net/
// @version      0.3.5
// @description  just test
// @author       shiquda
// @match        *://*/*
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
// @require      https://unpkg.com/turndown/dist/turndown.js
// @require      https://unpkg.com/@guyplusplus/turndown-plugin-gfm/dist/turndown-plugin-gfm.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.0/marked.min.js
// @license      AGPL-3.0
// ==/UserScript==

(function(){
    console.log(`body: \n${$('body')}`);
})();

报错信息:

jq test.user.js:12  Uncaught TypeError: n[o].hasOwnProperty is not a function
    at t.widget.extend (jq test.user.js:12:5035)
    at t.widget.extend (jq test.user.js:12:5149)
    at t.widget.extend (jq test.user.js:12:5149)
    at t.widget.extend (jq test.user.js:12:5122)
    at t.widget (jq test.user.js:12:4607)
    at jq test.user.js:16:29778
    at jq test.user.js:12:73
    at jq test.user.js:12:84
    at window.kHxzxycwBjdzPMwa (jq test.user.js:1197:3)
    at e.value (<anonymous>:3:392444)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compatibility其它管理器可以运行,脚本猫不能运行

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions