1

In greasemonkey javascript i need to read a JSON data file from local drive(e.g c: drive). How i can read ?

tried to use :- GM_getResourceText

// ==UserScript==
// @name            ####
// @version         1
// @grant           GM.xmlHttpRequest
// @grant           GM_getResourceText
// @include         https://www.#####
// ==/UserScript==

function ButtonClickAction() {
    GM.xmlHttpRequest({
        method: post,
        url: restURL,
        data: restJSONData,
        headers: {
            "Content-Type": "application/json"
        },
        onload: function(response) {
            console.log(response.responseText);        }
    });
}

restJSONdata, i need to read from local drive because its a big data.

Not able to read it.

0 Answers0