@resource tag does not work when the file is too big
LionGod8 opened this issue · 1 comments
LionGod8 commented
Expected Behavior
When adding a @resource
tag to the script with the name of the resource and a file URL, TamperMonkey should load with the resource available to get it with GM_getResourceText
.
Actual Behavior
When adding a @resource
tag to the script with the name of the resource and a file URL, no matter if it's from HTTP/HTTPS or local file (i.e. file:///C:/aa/myfile.txt
) - if the file is big enough (I tested on a 77 MB file), TamperMonkey doesn't load at all (not even with other scripts).
Also, I tried to load the local file (from the filesystem) another way using GM_xmlhttpRequest
but I get this error: Refused to connect to "file:///C:/aa/myfile.txt": Access to this local file is forbidden!
Specifications
- Chromium: 113.0.5672.93
- TM: 4.19.6183
- OS: Windows 10 Home 10.0.19045
Script
// ==UserScript==
// @name MyName
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description try to take over the world!
// @author Me
// @match http://mywebsite.com/*
// @resource myResource file:///C:/aa/myfile.txt
// @grant GM_getResourceText
// ==/UserScript==
function() {
console.log(GM_getResourceText("myResource"));
})();