init
BIN
1000_bots_webextension/.DS_Store
vendored
Normal file
76
1000_bots_webextension/background.js
Normal file
@ -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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'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"]
|
||||||
|
);
|
BIN
1000_bots_webextension/icon_OFF_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
1000_bots_webextension/icon_ON_48.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
22
1000_bots_webextension/manifest.json
Normal file
@ -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
|
||||||
|
}
|
@ -1,2 +1,4 @@
|
|||||||
# 1000_bots_webextension
|
# 1000_bots_webextension
|
||||||
|
|
||||||
|
google bot user agent browser extension
|
||||||
|
Logo from https://commons.wikimedia.org/wiki/File:Google_%22G%22_Logo.svg
|
||||||
|
BIN
gfx/100scores_titleimage.psd
Normal file
BIN
gfx/Screenshot_2020-09-02_18-14-14.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
gfx/Screenshot_2020-09-02_18-15-01.png
Normal file
After Width: | Height: | Size: 53 KiB |
1
gfx/logo/Google_ G _Logo.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg viewBox="0 0 533.5 544.3" xmlns="http://www.w3.org/2000/svg"><path d="M533.5 278.4c0-18.5-1.5-37.1-4.7-55.3H272.1v104.8h147c-6.1 33.8-25.7 63.7-54.4 82.7v68h87.7c51.5-47.4 81.1-117.4 81.1-200.2z" fill="#4285f4"/><path d="M272.1 544.3c73.4 0 135.3-24.1 180.4-65.7l-87.7-68c-24.4 16.6-55.9 26-92.6 26-71 0-131.2-47.9-152.8-112.3H28.9v70.1c46.2 91.9 140.3 149.9 243.2 149.9z" fill="#34a853"/><path d="M119.3 324.3c-11.4-33.8-11.4-70.4 0-104.2V150H28.9c-38.6 76.9-38.6 167.5 0 244.4l90.4-70.1z" fill="#fbbc04"/><path d="M272.1 107.7c38.8-.6 76.3 14 104.4 40.8l77.7-77.7C405 24.6 339.7-.8 272.1 0 169.2 0 75.1 58 28.9 150l90.4 70.1c21.5-64.5 81.8-112.4 152.8-112.4z" fill="#ea4335"/></svg>
|
After Width: | Height: | Size: 689 B |
BIN
gfx/logo/Google_ G _Logo_blurred.psd
Normal file
BIN
gfx/logo/icon_OFF_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
gfx/logo/icon_ON_48.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
1
gfx/logo/version_0/Google_ G _Logo.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg viewBox="0 0 533.5 544.3" xmlns="http://www.w3.org/2000/svg"><path d="M533.5 278.4c0-18.5-1.5-37.1-4.7-55.3H272.1v104.8h147c-6.1 33.8-25.7 63.7-54.4 82.7v68h87.7c51.5-47.4 81.1-117.4 81.1-200.2z" fill="#4285f4"/><path d="M272.1 544.3c73.4 0 135.3-24.1 180.4-65.7l-87.7-68c-24.4 16.6-55.9 26-92.6 26-71 0-131.2-47.9-152.8-112.3H28.9v70.1c46.2 91.9 140.3 149.9 243.2 149.9z" fill="#34a853"/><path d="M119.3 324.3c-11.4-33.8-11.4-70.4 0-104.2V150H28.9c-38.6 76.9-38.6 167.5 0 244.4l90.4-70.1z" fill="#fbbc04"/><path d="M272.1 107.7c38.8-.6 76.3 14 104.4 40.8l77.7-77.7C405 24.6 339.7-.8 272.1 0 169.2 0 75.1 58 28.9 150l90.4 70.1c21.5-64.5 81.8-112.4 152.8-112.4z" fill="#ea4335"/></svg>
|
After Width: | Height: | Size: 689 B |
BIN
gfx/logo/version_0/Google_ G _Logo_blurred.psd
Normal file
BIN
gfx/logo/version_0/icon_OFF_16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
gfx/logo/version_0/icon_OFF_32.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
gfx/logo/version_0/icon_OFF_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
gfx/logo/version_0/icon_OFF_64.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
gfx/logo/version_0/icon_ON_16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
gfx/logo/version_0/icon_ON_32.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
gfx/logo/version_0/icon_ON_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
gfx/logo/version_0/icon_ON_64.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
1
gfx/logo/version_0/version_0/Google_ G _Logo.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg viewBox="0 0 533.5 544.3" xmlns="http://www.w3.org/2000/svg"><path d="M533.5 278.4c0-18.5-1.5-37.1-4.7-55.3H272.1v104.8h147c-6.1 33.8-25.7 63.7-54.4 82.7v68h87.7c51.5-47.4 81.1-117.4 81.1-200.2z" fill="#4285f4"/><path d="M272.1 544.3c73.4 0 135.3-24.1 180.4-65.7l-87.7-68c-24.4 16.6-55.9 26-92.6 26-71 0-131.2-47.9-152.8-112.3H28.9v70.1c46.2 91.9 140.3 149.9 243.2 149.9z" fill="#34a853"/><path d="M119.3 324.3c-11.4-33.8-11.4-70.4 0-104.2V150H28.9c-38.6 76.9-38.6 167.5 0 244.4l90.4-70.1z" fill="#fbbc04"/><path d="M272.1 107.7c38.8-.6 76.3 14 104.4 40.8l77.7-77.7C405 24.6 339.7-.8 272.1 0 169.2 0 75.1 58 28.9 150l90.4 70.1c21.5-64.5 81.8-112.4 152.8-112.4z" fill="#ea4335"/></svg>
|
After Width: | Height: | Size: 689 B |
BIN
gfx/logo/version_0/version_0/Google_ G _Logo_blurred.psd
Normal file
BIN
gfx/logo/version_0/version_0/icon_OFF_16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
gfx/logo/version_0/version_0/icon_OFF_32.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
gfx/logo/version_0/version_0/icon_OFF_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
gfx/logo/version_0/version_0/icon_OFF_64.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
gfx/logo/version_0/version_0/icon_ON_16.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
gfx/logo/version_0/version_0/icon_ON_32.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
gfx/logo/version_0/version_0/icon_ON_48.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
gfx/logo/version_0/version_0/icon_ON_64.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
6
make_zip.sh
Normal file
@ -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
|