In the past few days, Google ads have been stirred up, and a "search alliance" has been put on the right of the blog. At that time, I thought that a fool would search here, not to mention others, even though I habitually ran to the top right corner of Firefox to enter the search content. So, put it in that nice look (not nice too ).
Why didn't I change Google search in the top-right corner of Firefox to my own "search alliance. In this way, every time you search for songs, you will increase your advertising revenue. Just do what you say.
First, find the installation path of Firefox and see the Folder \ searchplugins \, which should be the same. XML, which should be the configuration file for Google search in the top-right corner of Firefox. After opening the file, there is not much content, and it will not be completely pasted here.
The preceding lines are not important. The content in the <image> label should be the icon displayed in front of the search box, which is base64-encoded. Then there are two <URL> tags. This is what we want to change.
First, let's talk about the actual URL used for searching from the Google search alliance. For example, the search keyword is "soli", as shown below:
Http://www.google.cn/search? Q = soli & SA = Google + % E6 % 90% 9C % E7 % B4 % A2 & Prog = Aff & Client = Pub-3437261252070022 & Channel = 5277995732 & Domains = Soli.cnblogs.com & HL = ZH-CN & Source = Sdo_sb & Sdo_rt = Chbjjcdpaakx8ap7crnic05leg5fx1jmx0rfrkfvtfrfxxoidh1q8cwwlt0oaq & Sitesearch =
Of course, "http://www.google.cn/search.pdf ?" The following is a series of parameters. The parameter name is on the left of each equal sign and the parameter value on the right. For example, "q = soli" means that the value of the parameter q is "soli ", that is, the content to be searched. Parameters are separated. You can search for the meanings of other parameters online. Google provides a wide range of parameters. For example:
Client: Your customer ID. Google provides a unique identifier for every registered AdSense user. For example, my account is pub-3437261252070022, that is, Google uses this number to determine the account under which the search is to be performed.
Channel: a channel.CodeWhen there is a choice, set a channel for each advertisement, and then you will be able to clearly know where your advertising is making money for yourself.
Return to Google. XML in Firefox and check the first <URL> tag. The content is as follows:
< URL Type = "Application/X-suggestions + JSON" Method = "Get" Template = "Http://suggestqueries.google.com/complete/search? Output = firefox & amp; client = firefox & amp; HL = {Moz: locale} & amp; q = {searchterms }" />
Among them, the value of the template variable is similar to the URL we mentioned above, there is also a "q = ......", This is the variable for the keyword to be searched. What does "{searchterms}" mean?This is an internal variable of Firefox. It indicates the content you enter in the search box in the top-right corner of Firefox, that is, the keyword you want to search. When you start searching, this stuff is replaced with the content you want to search for, such as "soli ".
Here, we should note that the parameters are not separated by "&", but are changed to "& amp;". We will replace this template with our own URL, as shown below:
< URL Type = "Application/X-suggestions + JSON" Method = "Get" Template = "Http://www.google.cn/search?Q = {searchterms}& Amp;Sa = Google + % E6 % 90% 9C % E7 % B4 % A2& Amp;Prog = aff& Amp;Clients = pub-3437261252070022& Amp;Channel = 1, 5277995732& Amp;Domains = soli.cnblogs.com& Amp;Hl = ZH-CN& Amp;Source = sdo_sb& Amp;Sdo_rt = chbjjcdpaakx8ap7crnic05leg5fx1jmx0rfrkfvtfrfxxoidh1q8cwwlt0oaq& Amp;Sitesearch =" />
Pay attention to the green part.
Let's look at the content of the second URL Tag:
< URL Type = "Text/html" Method = "Get" Template = "Http://www.google.com/search" >
< Param Name = "Q" Value = "{Searchterms }" />
< Param Name = "Ie" Value = "UTF-8" />
< Param Name = "Oe" Value = "UTF-8" />
< Param Name = "AQ" Value = "T" />
<! -- Dynamic Parameters -->
< Param Name = "Rls" Value = "{Moz: distributionid }:{ Moz: locale }:{ Moz: Official }" />
< Mozparam Name = "Client" Condition = "Defaultengine" Truevalue = "Firefox-" Falsevalue = "Firefox" />
</ URL >
Once we see "Q" and "{searchterms}", we immediately understand that this URL is actually to split the first URL and write it. After analysis, the second and second lines seem useless. delete them directly, split the parameters of our URL, and fill in the <param> tag, as shown below:
< URL Type = "Text/html" Method = "Get" Template = "Http://www.google.cn/search" >
< Param Name = "Q" Value = "{Searchterms }" />
< Param Name = "Sa" Value = "Google + % E6 % 90% 9C % E7 % B4 % A2" />
< Param Name = "Prog" Value = "Aff" />
< Param Name = "Client" Value = & Quot; pub-3437261252070022 & quot" />
< Param Name = "Channel" Value = "5277995732" />
< Param Name = "Domains" Value = "Soli.cnblogs.com" />
< Param Name = "Hl" Value = "ZH-CN" />
<ParamName= "Ie" Value= "UTF-8"/>
< Param Name = "Source" Value = "Sdo_sb" />
< Param Name = "Sdo_rt" Value = "Chbjjcdpaakx8ap7crnic05leg5fx1jmx0rfrkfvtfrfxxoidh1q8cwwlt0oaq" />
< Param Name = "Sitesearch" Value = "" />
</ URL >
Which line of the green label must exist. "Ie" is inputencoding, is the input character encoding, why is "UTF-8? Because the fourth line of Google. XML is "<inputencoding>UTF-8</Inputencoding> ".
All right, all done. Overwrite the modified Google. xml file (if you are not at ease, back up the file first), restart Firefox, and search by entering anything.
Here is my modified Google. XML (http://files.cnblogs.com/soli/google.xml) is a little different from what I mentioned above, because when I set up my "Google search alliance", I chose the first "search type".Google WebsearchAllow users to search for networks directly from your website. Therefore, the parameter domains = soli.cnblogs.com is not used.