我从网页中提取了用户名和密码(main.js),并尝试将它们存储在indexeddb(popup.js)中。到目前为止,popup.html(popup.js)可以手动存储用户名和密码。我想在有用户名和密码时调用popup.js中的函数。非常感谢你。
main.js中的功能
if (username && password)
{
if(confirm("Store domain with username and password?"))
{
//want to call function test() from popup.js
}
else
{
}
}
popup.js中的函数
function test()
{
alert("function called");
}
的manifest.json
{
"name": "PM Extension",
"version": "1.0",
"manifest_version": 2,
"description": "a Google Chrome extension",
"permissions": ["tabs"],
"browser_action": {
"default_icon": "icon.png" ,
"default_title": "PM Extension",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["http://*/*",
"https://*/*"
],
"js": ["jquery.min.js", "main.js"],
"run_at": "document_start"
}]
}
答案 0 :(得分:0)
select top 5 * from (select * from (values(null),(null),(null),(null),(null)) as Category(nil)) a
left join Brand on 1=1
LEFT OUTER JOIN
Product ON Brand.BrandId = Product.BrandId
GROUP BY Brand.BrandName
ORDER BY NoSold desc
chrome.runtime.sendMessage('Your string/ object/ whatever', function(response) {
console.log(response.farewell);
});