Solved: Firefox – Adding New Custom Search-Engine Trick

here is how to do it for Google-Chrome (the reason why I want it..)
UnFuck Google-Search Shitty-Results By Actually Pre-Removing / Pre-Avoiding Many Known-To-Be-Crappy Websites!

also available here:

Adding a new custom search engine to firefox, instead of modifying and keyword.URL that won’t work anymore in new versions of firefox.

needs apache(XAMPP will do just fine), local HOSTS file editing, basic understanding in .htaccess, JavaScript, HTML, developers-panel operations, 5 minutes of your time.

close down firefox.

(optional step)
edit your HOSTS file (C:\Windows\System32\drivers\etc\hosts or /system/etc/hosts),
this might need admin access, and removing the readonly attribute from the file,
giving your a real domain name in addition to domain-less localhost.
:1 localhost
::1       localhost
:1        localhost

save, run ipconfig /flushdns

start your apache server,
create a new firefox_search_button folder,
within this .htaccess file:

#this is an optional file
#to force sending out
#additional HTTP headers
#with the file itself.

<IfModule mod_mime.c>
  DefaultLanguage     en-US
  AddDefaultCharset   UTF-8
  AddType application/opensearchdescription+xml  xml

<FilesMatch "\.(?i:xml|xmlz)$">
  #include file-name header.
  ##<IfModule mod_setenvif.c>
  ##  SetEnvIf Request_URI "^.*/([^/]*)$" FILENAME=$1
  ##  Header set "Content-Disposition" "attachment;filename=\"%{FILENAME}e\""
  ##  UnsetEnv FILENAME

  #force mimetype
  <IfModule mod_mime.c> 
    ForceType application/opensearchdescription+xml

this index.html file for testing:

<!doctype html>
<html itemtype="" dir="ltr" lang="en-US">
<a type="application/opensearchdescription+xml" title="Install Search-Engine" href="your_search_engine_20170815.xml">Install Search-Engine</a>

and this your_search_engine_20170815.xml:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns=""
  <ShortName>Google (g-no-w3s)</ShortName>
  <Description> search (g-no-w3s)</Description>
<Image width="16" height="16">data:image/x-icon;base64,

<Url type="application/x-suggestions+json" method="GET" template=";q={searchTerms}"/>

<Url type="text/html" method="GET" template=";gbv=1&amp;q={searchTerms}" rel="searchform"></Url>


open firefox, start the developer-panel (F12), switch to the network tab,
then browse
click the link, and expect the Content-Type to have something like application/opensearchdescription+xml.

head over to,
hover over the line with Google (Default), the green button will be shown at the other side,
showing + Add to firefox, don’t click it just yet.
right click the green-button and choose “inspect element”.

(you should see the DOM-tree with the button element, which will be selected by default)

press F2 to edit the HTML of the element,

replace, what will appear to be something like this:

<a class="button add installer" data-hash="sha256:ad1f41a28222ad13500e646522c48a517109e0e6c1eac0d079dbbfc5728fcc51" href="/firefox/downloads/latest/google-default-1/addon-651932-latest.xml?src=search">
  <span>Add to Firefox</span>


<a class="button add installer" type="application/opensearchdescription+xml" href="">
  <span>Add to Firefox</span>

and click something else to the newly modified HTML will be effected.

quickly switch back to the page (without refreshing it or something..)
hover the mouse over the button and you should see the url shown below

click the button,
you can select the checkbox to allow it to be used by default.
select add it to firefox and it will be added to your list of search engines.

it will be kept in your list of search engines
and will be synced in your account so could even have it in your smartphone as well! :)

You could edit the your_search_engine_20170815.xml,
to have your desired website, and switches.

I’m using a modified URL of google-search.

the phrase {searchTerms} is preserved, and will be replaced with what you’ll be entering
in your addressbar when you’ll hit-ENTER (or the search bar).

and although you can specify it inside of the <Url> tag
like <Param name="q" value="{searchTerms}"/>, since I’m using
a complete google address with additional of spaces and -site: that should be escaped,
I’m simply dumping it there as it is.

just remember to replace & characters with &amp; in your URL,
since this IS AN XML after-all..

the end result will be the url, unescaped,
with your search term jammed into the place where the {searchTerms} was.

the entire thing is required to overcome firefox page-security,
(which is preety lame).

you can now remove the additions to your HOSTS file (keep in your HOSTS file at least once: localhost)
and remove the apache server.

If you’ve done something wrong you can always remove the added search-engine through about:preferences.

Info Pic Dump…