Skip to content

Instantly share code, notes, and snippets.

@anthony1x6000
Last active April 27, 2023 20:20
Show Gist options
  • Select an option

  • Save anthony1x6000/01d4f82327d6e5e8bcee32ea9110aa5b to your computer and use it in GitHub Desktop.

Select an option

Save anthony1x6000/01d4f82327d6e5e8bcee32ea9110aa5b to your computer and use it in GitHub Desktop.
Use with Brave search. Instead of using Bing or Google as an image service for Brave Search, this userscript uses StartPage as an image service. Part of its own repo now: https://github.com/anthony1x6000/BraveSearch-with-Startpage-Images
// ==UserScript==
// @name Brave to Startpage Images
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Use StartPage as an image service for Brave Search.
// @author anthony1x6000
// @match https://search.brave.com/search?q=*
// @icon https://brave.com/static-assets/images/brave-favicon.png
// @grant none
// ==/UserScript==
(function() {
'use strict';
function storeValue() {
let searchBox = document.querySelector("#searchbox");
let searchValue = searchBox.value;
return searchValue;
}
let popup;
let imgredir;
let SPpreference;
let tabImages = document.querySelector("#tab-images");
tabImages.onclick = function() {
SPpreference = "prfe=" + "adfa3411ba8020cd76c17db84e9cb1bb72ed463f538f4b3f308bc6f294facedabfc8d5d231f716d048f5419444e3f969f432445f5268362ac9d1d9ad03bf78892908f9f6d0a683f079b4f2d1";
imgredir = `https://www.startpage.com/sp/search?${SPpreference}&query=${storeValue()}&cat=images`;
window.open(imgredir);
popup = document.querySelector("#tab-images > div");
popup.remove();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment