Skip to content

@require 引入依赖后出错 #260

@shiquda

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)

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