0
我想使用last.fm & plug.dj API扩展它,直到我开始将脚本嵌入到扩展中,然后发现我无法连接他们都没有。这是安装脚本:扩展找不到类
function Setup(){
console.log('Setup');
API.addEventListener(API.DJ_ADVANCE, callback);
cache = new LastFMCache();
lastfm = new LastFM({
apiKey: '<key>',
apiSecret: '<secret>',
cache: cache
});
}
在我的manifest.json()在我访问其他API脚本以下的新LastFMCache
{
"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
}
错误以及其他地方。其他脚本被加载(如lastFMLink.js和lastFMLink.css),堰事件是事件监听器的工作
安装脚本get按钮上加载时,它尚未初始化,所以通常它没有错误的脚本顺序。
任何人有任何线索可能会出错?