source code of /oops/autosearch.js

Last modified
Lines 13

Parent directory Download CGIread sitemap Main page

Quick links: (none)

  1. window.onload = function()
  2. {
  3.     const search_engine = "https://www.startpage.com/do/asearch?q=";
  4.     const domain = "oskog97.com";  // Add a site: operator here if you want.
  5.     
  6.     var this_page = location.href.replace(location.origin,'');
  7.     var search_query = domain + this_page.replace(/[^A-Za-z0-9]/g, "+");
  8.     // There is always a leading slash in this_page. No need to add anything.
  9.     
  10.     var iframe = document.querySelector("iframe#autosearch");
  11.     iframe.setAttribute("src", search_engine + search_query);
  12. };