@require 引入依赖后出错
Closed this issue · 1 comments
shiquda commented
在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)
CodFrm commented