diff --git a/1000_bots_webextension/.DS_Store b/1000_bots_webextension/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/1000_bots_webextension/.DS_Store differ diff --git a/LICENSE b/1000_bots_webextension/LICENSE similarity index 100% rename from LICENSE rename to 1000_bots_webextension/LICENSE diff --git a/1000_bots_webextension/background.js b/1000_bots_webextension/background.js new file mode 100644 index 0000000..313339f --- /dev/null +++ b/1000_bots_webextension/background.js @@ -0,0 +1,76 @@ +/* + 1000 Bots - browser extension to surf the www like a google-bot + Copyright (C) 2020 !Mediengruppe Bitnik, connect@bitnik.org + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + +'use strict'; + +var browser = browser || chrome +var user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"; +var target_urls = "*://*/*"; +var status = 0; + + +function set_extension_status_ON() { + status = 1; + console.log('Setting status to ON'); + browser.browserAction.setIcon({path: 'icon_ON_48.png'}); +} + +function set_extension_status_OFF() { + status = 0; + console.log('Setting status to OFF'); + browser.browserAction.setIcon({path: 'icon_OFF_48.png'}); +} + +function update_icon(){ + if(status == 0) { + set_extension_status_ON(); + }else{ + set_extension_status_OFF(); + } +} + + +function rewrite_user_agent_header(e){ + + // console.log('Browser http request!'); + + if(status == 0) { + // console.log('Nothing to do'); + return {requestHeaders: e.requestHeaders}; + } + + for (var header of e.requestHeaders) { + if (header.name.toLowerCase() === "user-agent") { + header.value = user_agent; + } + } + // console.log('Set user-agent header to: ' + user_agent); + return {requestHeaders: e.requestHeaders}; + +} + + +browser.runtime.onStartup.addListener(set_extension_status_OFF); +browser.browserAction.onClicked.addListener(update_icon); + +browser.webRequest.onBeforeSendHeaders.addListener( + rewrite_user_agent_header, + {urls: [target_urls]}, + ["blocking", "requestHeaders"] +); diff --git a/1000_bots_webextension/icon_OFF_48.png b/1000_bots_webextension/icon_OFF_48.png new file mode 100644 index 0000000..4ac940e Binary files /dev/null and b/1000_bots_webextension/icon_OFF_48.png differ diff --git a/1000_bots_webextension/icon_ON_48.png b/1000_bots_webextension/icon_ON_48.png new file mode 100644 index 0000000..28d3429 Binary files /dev/null and b/1000_bots_webextension/icon_ON_48.png differ diff --git a/1000_bots_webextension/manifest.json b/1000_bots_webextension/manifest.json new file mode 100644 index 0000000..9ef886b --- /dev/null +++ b/1000_bots_webextension/manifest.json @@ -0,0 +1,22 @@ +{ + "homepage_url": "https://1000scores.com", + "name": "1000 Bots", + "browser_specific_settings": { + "gecko": { + "id": "trash@bitnik.org", + "strict_min_version": "55.0" + } + }, + "description": "Surf the net as the most famous internet user - the google bot.", + "version": "0.0.1", + "background": { + "scripts": ["background.js"], + "persistent": true + }, + "permissions": ["storage", "webRequest", "webRequestBlocking", "*://*/*"], + "browser_action": { + "name": "Click to change your browsers perspective", + "default_icon": "icon_OFF_48.png" + }, + "manifest_version": 2 +} diff --git a/README.md b/README.md index 70b6efa..02bfec2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # 1000_bots_webextension +google bot user agent browser extension +Logo from https://commons.wikimedia.org/wiki/File:Google_%22G%22_Logo.svg diff --git a/gfx/100scores_titleimage.psd b/gfx/100scores_titleimage.psd new file mode 100644 index 0000000..3796d89 Binary files /dev/null and b/gfx/100scores_titleimage.psd differ diff --git a/gfx/Screenshot_2020-09-02_18-14-14.png b/gfx/Screenshot_2020-09-02_18-14-14.png new file mode 100644 index 0000000..31378d4 Binary files /dev/null and b/gfx/Screenshot_2020-09-02_18-14-14.png differ diff --git a/gfx/Screenshot_2020-09-02_18-15-01.png b/gfx/Screenshot_2020-09-02_18-15-01.png new file mode 100644 index 0000000..e35988c Binary files /dev/null and b/gfx/Screenshot_2020-09-02_18-15-01.png differ diff --git a/gfx/logo/Google_ G _Logo.svg b/gfx/logo/Google_ G _Logo.svg new file mode 100644 index 0000000..c06982f --- /dev/null +++ b/gfx/logo/Google_ G _Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gfx/logo/Google_ G _Logo_blurred.psd b/gfx/logo/Google_ G _Logo_blurred.psd new file mode 100644 index 0000000..c94a2f0 Binary files /dev/null and b/gfx/logo/Google_ G _Logo_blurred.psd differ diff --git a/gfx/logo/icon_OFF_48.png b/gfx/logo/icon_OFF_48.png new file mode 100644 index 0000000..4ac940e Binary files /dev/null and b/gfx/logo/icon_OFF_48.png differ diff --git a/gfx/logo/icon_ON_48.png b/gfx/logo/icon_ON_48.png new file mode 100644 index 0000000..28d3429 Binary files /dev/null and b/gfx/logo/icon_ON_48.png differ diff --git a/gfx/logo/version_0/Google_ G _Logo.svg b/gfx/logo/version_0/Google_ G _Logo.svg new file mode 100644 index 0000000..c06982f --- /dev/null +++ b/gfx/logo/version_0/Google_ G _Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gfx/logo/version_0/Google_ G _Logo_blurred.psd b/gfx/logo/version_0/Google_ G _Logo_blurred.psd new file mode 100644 index 0000000..c94a2f0 Binary files /dev/null and b/gfx/logo/version_0/Google_ G _Logo_blurred.psd differ diff --git a/gfx/logo/version_0/icon_OFF_16.png b/gfx/logo/version_0/icon_OFF_16.png new file mode 100644 index 0000000..9d46921 Binary files /dev/null and b/gfx/logo/version_0/icon_OFF_16.png differ diff --git a/gfx/logo/version_0/icon_OFF_32.png b/gfx/logo/version_0/icon_OFF_32.png new file mode 100644 index 0000000..905d286 Binary files /dev/null and b/gfx/logo/version_0/icon_OFF_32.png differ diff --git a/gfx/logo/version_0/icon_OFF_48.png b/gfx/logo/version_0/icon_OFF_48.png new file mode 100644 index 0000000..808d1ee Binary files /dev/null and b/gfx/logo/version_0/icon_OFF_48.png differ diff --git a/gfx/logo/version_0/icon_OFF_64.png b/gfx/logo/version_0/icon_OFF_64.png new file mode 100644 index 0000000..e6d47d1 Binary files /dev/null and b/gfx/logo/version_0/icon_OFF_64.png differ diff --git a/gfx/logo/version_0/icon_ON_16.png b/gfx/logo/version_0/icon_ON_16.png new file mode 100644 index 0000000..6b02f62 Binary files /dev/null and b/gfx/logo/version_0/icon_ON_16.png differ diff --git a/gfx/logo/version_0/icon_ON_32.png b/gfx/logo/version_0/icon_ON_32.png new file mode 100644 index 0000000..45d5e4c Binary files /dev/null and b/gfx/logo/version_0/icon_ON_32.png differ diff --git a/gfx/logo/version_0/icon_ON_48.png b/gfx/logo/version_0/icon_ON_48.png new file mode 100644 index 0000000..23ead95 Binary files /dev/null and b/gfx/logo/version_0/icon_ON_48.png differ diff --git a/gfx/logo/version_0/icon_ON_64.png b/gfx/logo/version_0/icon_ON_64.png new file mode 100644 index 0000000..e452037 Binary files /dev/null and b/gfx/logo/version_0/icon_ON_64.png differ diff --git a/gfx/logo/version_0/version_0/Google_ G _Logo.svg b/gfx/logo/version_0/version_0/Google_ G _Logo.svg new file mode 100644 index 0000000..c06982f --- /dev/null +++ b/gfx/logo/version_0/version_0/Google_ G _Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gfx/logo/version_0/version_0/Google_ G _Logo_blurred.psd b/gfx/logo/version_0/version_0/Google_ G _Logo_blurred.psd new file mode 100644 index 0000000..c94a2f0 Binary files /dev/null and b/gfx/logo/version_0/version_0/Google_ G _Logo_blurred.psd differ diff --git a/gfx/logo/version_0/version_0/icon_OFF_16.png b/gfx/logo/version_0/version_0/icon_OFF_16.png new file mode 100644 index 0000000..9d46921 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_OFF_16.png differ diff --git a/gfx/logo/version_0/version_0/icon_OFF_32.png b/gfx/logo/version_0/version_0/icon_OFF_32.png new file mode 100644 index 0000000..905d286 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_OFF_32.png differ diff --git a/gfx/logo/version_0/version_0/icon_OFF_48.png b/gfx/logo/version_0/version_0/icon_OFF_48.png new file mode 100644 index 0000000..808d1ee Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_OFF_48.png differ diff --git a/gfx/logo/version_0/version_0/icon_OFF_64.png b/gfx/logo/version_0/version_0/icon_OFF_64.png new file mode 100644 index 0000000..e6d47d1 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_OFF_64.png differ diff --git a/gfx/logo/version_0/version_0/icon_ON_16.png b/gfx/logo/version_0/version_0/icon_ON_16.png new file mode 100644 index 0000000..6b02f62 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_ON_16.png differ diff --git a/gfx/logo/version_0/version_0/icon_ON_32.png b/gfx/logo/version_0/version_0/icon_ON_32.png new file mode 100644 index 0000000..45d5e4c Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_ON_32.png differ diff --git a/gfx/logo/version_0/version_0/icon_ON_48.png b/gfx/logo/version_0/version_0/icon_ON_48.png new file mode 100644 index 0000000..23ead95 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_ON_48.png differ diff --git a/gfx/logo/version_0/version_0/icon_ON_64.png b/gfx/logo/version_0/version_0/icon_ON_64.png new file mode 100644 index 0000000..e452037 Binary files /dev/null and b/gfx/logo/version_0/version_0/icon_ON_64.png differ diff --git a/make_zip.sh b/make_zip.sh new file mode 100644 index 0000000..5bfbb2e --- /dev/null +++ b/make_zip.sh @@ -0,0 +1,6 @@ +#!/bin/bash +now=$(date +"%y_%m_%d_%H_%M") +zip_filename="1000_scores_webextension_$now.zip" +cd 1000_bots_webextension/ +zip -r -FS ../$zip_filename * --exclude '*.git*' +echo $zip_filename