I'm trying to write a new Chrome Extension and I was trying to use AngularJS on it.
So, I have this on my manifest.json:
{
"manifest_version": 2,
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["content.js"]
}
],
"permissions": [
"*://*/*",
"tabs"
]
}
The content.js
already have angular injected into it.
But when I open a page that already uses Angular, the page crashes, the page is unable to load the module configured by the original page... It's like including Angular into the extension makes Angular "resets" the modules (which should not happen since the docs say something about the isolated scope, and how extensions can't mess with the original page stuff)...
Any idea on how to fix this?
PS: I did a test where I make the content_script
to be just the angular.js
file (1.2.0rc3) and just by that any page that uses angular is broken as described before...
I created a gist to reproduce the issue: https://gist.github.com/wilkerlucio/7260370#file-manifest-json
To reproduce this behave, do this:
- clone this gist: https://gist.github.com/wilkerlucio/7260370
- add the cloned folder as an unpacked extension on chrome
- visit some page that uses angular, ex: http://docs.deployd.com/docs/collections/examples/a-simple-todo-app-with-angular.md
- check the console