I'm trying to read a chrome extension file (chrome://gtdinbox/
testfile.txt) from within a content script (in the same extension).
In particular, it would be fantastic to be able to do this
synchronously because the depending code is then much more
maintainable.
The core function is built around the following XHR:
var req = new XMLHttpRequest();
req.open('GET', filename, false);
req.send(null);
if( req.status==0 ) return req.responseText;
So far, I tried,
1) Synchronous XHR from content script: failed due to permissions.
2) Synchronous XHR from background page: worked, but has to use Chrome
port message passing to return the data to the content script, which
is asynchronous.
3) A kludge of iframe/script elements to load the data, but all are
asynchonrous.
Am I missing something trivial?
A related question is, are there any plans for synchronous message
passing in Chrome?
Andy
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
I've just spotted what looks like a similar thread:
http://groups.google.com/a/chromium.org/group/chromium-extensions/browse_thread/thread/7d90e4c50f5e3dea/ff9053ecfd002c55
I don't want to duplicate anything that gets answered elsewhere.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>