Javascript chrome扩展的background.js中的异步ajax
这是我的background.jsJavascript chrome扩展的background.js中的异步ajax,javascript,google-chrome,google-chrome-extension,Javascript,Google Chrome,Google Chrome Extension,这是我的background.js chrome.runtime.onInstalled.addListener(function() { chrome.declarativeContent.onPageChanged.removeRules(undefined, function() { chrome.declarativeContent.onPageChanged.addRules([{ conditions: [
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [
// When a page contains a <video> tag...
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: 'www.youtube.com'}
})
],
// ... show the page action.
actions: [new chrome.declarativeContent.ShowPageAction() ]
}]);
});
});
chrome.runtime.onInstalled.addListener(函数(){
chrome.declarativeContent.onPageChanged.removeRules(未定义,函数(){
chrome.declarativeContent.onPageChanged.addRules([{
条件:[
//当页面包含标记时。。。
新chrome.declarativeContent.PageStateMatcher({
pageUrl:{hostEquals:'www.youtube.com'}
})
],
//…显示页面操作。
操作:[新建chrome.declarativeContent.ShowPageAction()]
}]);
});
});
我应该在哪里插入ajax?以及如何使用jquery?就像my background.js中的$.post?不可能从你的问题中猜出你想要达到什么目的。@Xan编辑了我的问题,对不起。