Chrome extension failed to load javascript because of protocol-relative URL

2,621 views
Skip to first unread message

Yervand Khalapyan

unread,
Sep 1, 2014, 8:12:17 AM9/1/14
to chromium-...@chromium.org

I'm developing a Chrome extension where I load a javascript file from external domain to which I have no access. This javascript in it's turn loads another javascript with relative protocol method //exemple.com/javascript.js. And the problem is: I get an error

Failed to load resource: net::ERR_FAILED chrome-extension://exemple.com/javascript.js

P.S. My manifest looks like this "content_security_policy": "script-src 'self' https://example.com 'unsafe-eval'; object-src 'self' https://example.com"

PhistucK

unread,
Sep 1, 2014, 8:14:22 AM9/1/14
to Yervand Khalapyan, Chromium-extensions
You will have to change the relative protocol to an explicit protocol.


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/ceb840e1-55e8-4ce8-9dd9-1ef6c284ec96%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Yervand Khalapyan

unread,
Sep 1, 2014, 8:20:49 AM9/1/14
to chromium-...@chromium.org, erva...@gmail.com
I have no access to the javascript file. Is this the only way?


On Monday, September 1, 2014 4:14:22 PM UTC+4, PhistucK wrote:
You will have to change the relative protocol to an explicit protocol.


PhistucK


On Mon, Sep 1, 2014 at 3:12 PM, Yervand Khalapyan <erva...@gmail.com> wrote:

I'm developing a Chrome extension where I load a javascript file from external domain to which I have no access. This javascript in it's turn loads another javascript with relative protocol method //exemple.com/javascript.js. And the problem is: I get an error

Failed to load resource: net::ERR_FAILED chrome-extension://exemple.com/javascript.js

P.S. My manifest looks like this "content_security_policy": "script-src 'self' https://example.com 'unsafe-eval'; object-src 'self' https://example.com"

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

PhistucK

unread,
Sep 1, 2014, 8:52:26 AM9/1/14
to Yervand Khalapyan, Chromium-extensions
I believe so. Perhaps you can run within an iFrame that points to an actual server.


PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages