Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.37k stars 428 forks source link

Firefox: couldn't load @require from URL file:// #1178

Open nmaxcom opened 3 years ago

nmaxcom commented 3 years ago

I have been searching for 30 minutes and still don't know what is the best solution to this problem. I have searched for and found the bug threads in Firefox regarding permissions, issues in this repo talking about this, hints in the documentation... Information is either old, wrong or missing. I'll love to update the documentation once I know what can be done.

Some solutions indicated doing something like what it's shown in the documentation:

image

However this option is not found in TM's settings or Firefox's.

Expected Behavior

Tampermonkey loading a local userscript in Firefox using @require, to allow a reasonable development feedback loop, just as I do in Chrome.

Actual Behavior

The script doesn't load, console throws: "Tampermonkey: couldn't load @require from URL file:///Users/.../SearchSelected.user.js"

Script

// ==UserScript==
// @name         Search for selected text or open url
// @version      1
// @author       nmaxcom
// @match        *://*/*
// @require      file:///Users/.../SearchSelected.user.js
// @license      MIT
// ==/UserScript==
derjanb commented 3 years ago

Please see https://github.com/Tampermonkey/tampermonkey/issues/347#issuecomment-269039234

However, I'll add this to the documentation.

nmaxcom commented 3 years ago

So am I correct in understanding that requiring a local file is not possible for TM in Firefox?

derjanb commented 3 years ago

Yes. This is Firefox's feature request to implement user configurable extension file access: https://bugzilla.mozilla.org/show_bug.cgi?id=1266960