how i can get resources from a local files with tampermonkey without making a refresh to the web page?

Viewed 265

Take a look at this code. I want to get resources from a local file which is, for example, 1.txt and print the content of it in a console log this code print the content but I want every time I change the content of the file (1.txt) and save it, it changes without making a refresh to the web page so I'm wondering if you can modify the code to do what I want or is there another way with different code

Thanks

 // ==UserScript==
// @name         test
// @namespace    http://tampermonkey.net/
// @version      1.0.0.1
// @description  you
// @author       You
// @match        https://www.google.com/
// @grant       GM_getResourceText
// @resource    a file://C:/FORM/1.txt
// ==/UserScript==

function test() {
var b = GM_getResourceText('a')
console.log(b)

}

var stopconsubmit = setInterval(test, 1*1000);
0 Answers
Related