Hey,
I want to load a Local Js file dynamically in https://web.whatsapp.com/.
My Project Folder Structure is....
I have tried to do it using following....
manifest.json file
{
"name": "Assignment 1.1",
"manifest_version": 2,
"version": "1.0",
"web_accessible_resources": ["jquery-3.1.1.min.js", "test.js"]
}
test.js file
$(document).ready(function () {
jQuery.fn.outerHTML = function () {
return jQuery('
').append(this.eq(0).clone()).html();
};
var html = $("html").outerHTML();
alert(html);
});
My Created Extension in Chrome Browser.....
Error in Console while injecting a Js file....
Error message:- Denying load of chrome-extension://cgcghfdjhjcplknknigoklaleahdfllp/. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
GET chrome-extension://invalid/ net::ERR_FAILED
Herewith I am attaching Source Code. Any help would be appreciated.
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Parth DavePosted Feb 20, 2017, 1:15 PM
Parth DavePosted Feb 20, 2017, 12:06 AM
loadjscssfile("myscript.js","js"); function as I want to load my local Js file in https://web.whatsapp.com/ page and I don't have its source code on my local machine. Please suggest me the steps.Nicholas DautremontPosted Feb 19, 2017, 5:38 PM