You can load local files from the chrome-extension directory.

Try:

var id = self.chrome.extension.id_;
mMYFrame.src = "chrome-extension://"+id+"/myfile.html";


-v1c1ous

On Sep 2, 4:22 pm, mack <[email protected]> wrote:
> How can I load a local html file from a user script?
>
> I tried:
>
> // ==UserScript==
> // @name A script
> // @description My Test
> // @match http://*/*
> // @match file://*/*
> // @run-at document-start
> // ==/UserScript==
>
> var vHTML = document.getElementsByTagName('HTML')[0];
> mMYFrame = document.createElement('IFRAME');
> mMYFrame.src = 'file://C:/test.html';
> vHTML.appendChild(mMYFrame );
>
> This code works when I load local URLs in the browser (ex:
> file://C:/Tests/main.html); it doesn't do it for remote URLs 
> (ex:http://www.google.com).
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to