0

I have js called iframeInjector

var iFrame  = document.createElement ("iframe");
iFrame.src  = chrome.extension.getURL ("http://google.com");

document.body.insertBefore (iFrame, document.body.firstChild);

than I have this manifest: { "manifest_version": 2,

"content_scripts":          [ {
    "js":       [ "iframeInjector.js" ],
    "matches":  [   "https://*/*","<all_urls>"
    ]
} ],
"description":              "Inject a google site",
"name":                     "Inject google",
"version":                  "1",

} but when I open site iframe url is chrome-extension://dhnpacpfjbnmnbefjlfgemkphjilciak/http://google.com. What Im doing wrong?

pajamac
  • 113
  • 13

1 Answers1

0

chrome.extension.getURL is for local resouces only. You don't need to use it for HTTP links.

However, Google expressly disallows embedding into iframes. It will detect running in a frame and will not work.

Community
  • 1
  • 1
Xan
  • 74,770
  • 16
  • 179
  • 206