scriptscat / scriptcat

脚本猫,一个可以执行用户脚本的浏览器扩展
https://docs.scriptcat.org
GNU General Public License v3.0
1.33k stars 125 forks source link

@require 不支持本地文件 #33

Open ChitaGideon opened 2 years ago

ChitaGideon commented 2 years ago
// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.baidu.com/*
// @icon         https://www.google.com/s2/favicons?domain=baidu.com
// @require      file:///Users/xxx/xxx/xxx/bundle2.js
// @grant        GM_log
// ==/UserScript==

(function() {
    'use strict';
// Your code here...
    console.log('window.initDb')
    console.log(window.initDb())

    // Your code here...
})();

我已经开启了 允许访问文件网址 选项

CodFrm commented 2 years ago

暂时没支持本地文件require,如果是想使用外部编辑器开发,可以试试vscode-scriptcat扩展,在b站有演示,还不是很完善