2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/6558 - added web extension for extracting document urls

This commit is contained in:
Mihai Branescu 2020-04-08 15:49:21 +03:00 committed by Jeff Boek
parent f765736b27
commit 15552a39c3
2 changed files with 41 additions and 0 deletions

View File

@ -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);

View File

@ -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"
]
}