这个扩展对我不起作用?
This extension doesn't work for me?
这是我的 manifest.json:
{
"manifest_version": 2,
"name": "ROBLOX Forum Link Fixer",
"description": "Fixes the amp; issue on the ROBLOX forum.",
"version": "2.0",
"background": {
"scripts": [
"jquery.js",
"fixer.js"
]
},
"permissions": [
"http://*.roblox.com/*",
"https://*.roblox.com/*"
]
}
这是 fixer.js 的内部(jquery.js 只是 jQuery):
$(document).ready(function(){
$('.rbx-link.user-link').each(function(){
$(this).text($(this).text().replace(/amp;/g, ""));
$(this).attr("href",$(this).text());
});
});
错误是它不起作用,我不知道为什么?!我希望有人能帮帮忙!谢谢
我认为你必须使用像
这样的内容脚本权限
"content_scripts": [
{
"matches": ["http://www.google.co.in/*",
"https://www.google.co.in/*"],
"js": ["myscript.js"]
}
]
}
而不是背景见https://developer.chrome.com/extensions/content_scripts
这是我的 manifest.json:
{
"manifest_version": 2,
"name": "ROBLOX Forum Link Fixer",
"description": "Fixes the amp; issue on the ROBLOX forum.",
"version": "2.0",
"background": {
"scripts": [
"jquery.js",
"fixer.js"
]
},
"permissions": [
"http://*.roblox.com/*",
"https://*.roblox.com/*"
]
}
这是 fixer.js 的内部(jquery.js 只是 jQuery):
$(document).ready(function(){
$('.rbx-link.user-link').each(function(){
$(this).text($(this).text().replace(/amp;/g, ""));
$(this).attr("href",$(this).text());
});
});
错误是它不起作用,我不知道为什么?!我希望有人能帮帮忙!谢谢
我认为你必须使用像
这样的内容脚本权限"content_scripts": [
{
"matches": ["http://www.google.co.in/*",
"https://www.google.co.in/*"],
"js": ["myscript.js"]
}
]
}
而不是背景见https://developer.chrome.com/extensions/content_scripts