I'm trying to make an chrome extension with the last.fm & plug.dj API's it used to work until I started embedding my scripts in the extension, and sinds then I can't connect to neither of them. This is the setup script:
function Setup(){
console.log('Setup');
API.addEventListener(API.DJ_ADVANCE, callback);
cache = new LastFMCache();
lastfm = new LastFM({
apiKey: '<key>',
apiSecret: '<secret>',
cache: cache
});
}
with the following in my manifest.json
{
"content_scripts": [ {
"js": [ "jquery.js","lastfm.api.md5.js", "lastfm.api.cache.js", "lastfm.api.js","lastFMLink.js", "script.js"],
"css": [ "LastFMLink.css" ],
"matches": [ "http://plug.dj/*", "http://plug.dj/*/*" ],
"run_at": "document_end"
} ],
"name": "Plug.Dj VS last.Fm",
"description": "Implement information about the artist",
"icons": { "16": "cookie.png", "48": "cookie.png", "128": "cookie.png" },
"permissions": [ "http://plug.dj/*", "http://plug.dj/*/*" ],
"version": "0.0.1",
"web_accessible_resources": [ "lastFMLink.js"],
"manifest_version": 2
}
it errors on the new LastFMCache() and somewhere else in the script where I access the other API. the other scripts get loaded (like lastFMLink.js and lastFMLink.css) and the weir thing is the event listener does work
the setup script get's loaded when pressed on a button and it isn't initialized yet, so normally it isn't erroring due script order.
anyone got any clues what might be going wrong?