On Fri, Aug 24, 2012 at 10:21 AM, Jim Klo <
jim...@sri.com> wrote:
> See inline:
>
> On Aug 24, 2012, at 9:58 AM, John J Barton wrote:
>
>
>
> On Thu, Aug 23, 2012 at 7:22 PM, CGS <
cgsmc...@gmail.com> wrote:
>>
>> Hi,
>>
>> You can load external scripts only in tabs/windows (not in background
>> page, not popup in page). To do so, you need to set permissions to tabs as
>> well.
>
>
> Thanks, but I don't understand what this means. I have an extension with no
> tabs, windows, background or popup pages. I am using devtools extension
> which puts a chrome-extension:// url into an iframe.
>
>
> When you do this... you need to place each resource that's being accessed
> from the IFrame in the "web_accessible_resources" section of the manifest,
> at least that's what I had to do to make pages load using the internal
> chrome:// resource path.
Thanks, but web_accessible_resources allows extension resources to be
exported by an extension to a Web page. In my case I want to import a
Web resource into an extension.
>
>
>>
>> Also, I would recommend to use document.createElement('script') setting
>> the attribute src to whatever javascript file and appended as a child to
>> document.head or document.body (you can use any DOM element for that matter)
>> instead of AJAX requests (at least it works just fine for me). To insert the
>> script, Tabs and programmatic injection from the documentation
>> (
http://developer.chrome.com/extensions/tabs.html and
>>
http://developer.chrome.com/extensions/content_scripts.html).
>
>
> My goal is to re-compile the .js file to support ES6 features and Querypoint
> debugging. Therefore I need to access the XHR response first, then insert
> the script result or eval it in the page.
>
>
> You won't be able to eval. The CSP prevents that, and Chrome ignores all
> directives to override, AFAIK. You can only parse XHR responses to pass
> data models.
Thanks but this is not an issue for me. I can eval in a sandboxed
iframe or in the web page itself.
My issue is to be able to use cross-side XHR in an iframe with a
chrome-extension:// url given that I have set the permissions to allow
such access for the extension.
jjb