JS equivalent of – Pluto Jul 01 '15 at 18:09

  • Wait this is for running JS in a Chrome extension instead of a web page? – Pluto Jul 01 '15 at 18:15
  • Yeah. That's right. To run on a js file on a chrome ext. – krisho Jul 01 '15 at 18:18
  • 1
    It's not clear what you're trying to do. Specifically, "context.js of a Chrome extension" is meaningless, and so is "run[ning] on a js file". Are you trying to use `sap-ui-core.js` as a content script, but want the attribute pairs? Are you trying to programmatically inject the script, but want the attribute pairs? Is your problem running the script, or having the attribute pairs, or both? – Teepeemm Jul 01 '15 at 20:10
  • 1 Answers1

    0

    To run JS in an extension, it's recommended that all the code be packaged with your extension. This is to prevent the possibility of user's browsers becoming compromised. This just requires downloading the JS file, packaging it with your extension, and updating your extension once newer version becomes available if so desired.

    See here for the full documentation, including how to whitelist certain domains to use scripts from there: https://developer.chrome.com/extensions/contentSecurityPolicy#resourceLoading

    Pluto
    • 2,900
    • 27
    • 38