For #6558 - added web extension for extracting document urls
parent
f1559ed2da
commit
c4f7972f2b
@ -0,0 +1,17 @@
|
||||
function collect_urls(urls) {
|
||||
let anchors = document.getElementsByTagName("a");
|
||||
for (let anchor of anchors) {
|
||||
if (!anchor.href) {
|
||||
continue;
|
||||
}
|
||||
urls.push(anchor.href);
|
||||
}
|
||||
}
|
||||
let urls = [];
|
||||
collect_urls(urls)
|
||||
|
||||
let message = {
|
||||
'url': document.location.href,
|
||||
'urls': urls
|
||||
}
|
||||
browser.runtime.sendNativeMessage("MozacBrowserAds", message);
|
@ -0,0 +1,24 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Mozilla Android Components - Ads",
|
||||
"version": "1.0",
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://*/*"],
|
||||
"include_globs": [
|
||||
"https://www.google.*/search*",
|
||||
"https://www.baidu.com/s*",
|
||||
"https://www.baidu.com/baidu*",
|
||||
"https://*search.yahoo.com/search*",
|
||||
"https://www.bing.com/search*",
|
||||
"https://duckduckgo.com/*"
|
||||
],
|
||||
"js": ["ads.js"],
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"permissions": [
|
||||
"geckoViewAddons",
|
||||
"nativeMessaging"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue