Khizar Ali
Khizar Ali

Reputation: 514

Chrome Extension: content script is unable to load local HTML file into iframe

There is a content script defined in manifest.json. The content script is doing a simple task. It adds a iframe into page and trying to open a local HTML file into it.

The problem is:

ifrm.setAttribute("src", "http://www.xyz.com/");   //working correctly.

BUT

ifrm.setAttribute("src", chrome.extension.getURL("view/abc.html")); //Not working

The iframe is not opening a local HTML file.

Any suggestion...

Upvotes: 0

Views: 3553

Answers (1)

epascarello
epascarello

Reputation: 207557

You need to set the file in the web_accessible_resources and it is case sensitive.

Upvotes: 5

Related Questions