is it possible to load external js file in background script?

2,064 views
Skip to first unread message

Sungguk Lim

unread,
Jan 15, 2013, 3:57:35 PM1/15/13
to chromi...@chromium.org
Hi

Is it possible to load external js file in background script?  

for example, 
<script src="jquery.js"></script> at the top of background.js

Renato Mangini

unread,
Jan 15, 2013, 5:53:25 PM1/15/13
to Sungguk Lim, Chromium Apps
You can add as many scripts as you want - like "jquery.js" in your example - in the app.background.scripts array of manifest.json:
...
 "app": {
    "background": {
      "scripts": ["jquery.js", "background.js"]
    }
  },  
...

Renato Mangini | Chrome Developer Advocate | man...@google.com | +55 11 2395-8608



--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msg/chromium-apps/-/ZalqFqcHbF4J.
To post to this group, send email to chromi...@chromium.org.
To unsubscribe from this group, send email to chromium-app...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/?hl=en.

jason o'neal

unread,
Nov 9, 2018, 12:27:56 AM11/9/18
to Chromium-Apps-Announce, lim...@gmail.com, man...@google.com
Any way to do this programatically?

PhistucK

unread,
Nov 9, 2018, 4:09:57 AM11/9/18
to jason.al...@gmail.com, Chromium Apps, Sungguk Lim, man...@google.com
Does adding <script src="..."> using DOM operations (document.createElement, and document.head.appendChild) not work?

PhistucK


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

To post to this group, send email to chromi...@chromium.org.
Reply all
Reply to author
Forward
0 new messages