I'd like to include a common piece of javascript in my background
page. So far, the only way I see is adding at the top:
<script>
document.write("<script src='chrome-extension://" +
chrome.extension.id_ + "common.js'/>");
</script>
That seems ugly for at least two reasons: using document.write to
write a script tag, and having to use the private chrome.extension.id_
property, which is not part of the API and could presumably go away
(perhaps we need a getId() method?).
More generally, why is the background page HTML and not just included
javascript? Are there use cases for using actual HTML tags in the
page? It would be nice if we could specify one or more JS files, much
like content scripts, with the difference that they are instantiated
once and forever in the Chrome instance. The implementation itself
could just be including each script in an HTML page, if need be.
Thanks,
matias
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---