Firefox中自定义搜索引擎……

来源:互联网 发布:外贸服装行业数据分析 编辑:程序博客网 时间:2024/06/14 18:33

想给firefox添加https://版本的谷歌搜索引擎。搜了下发现:评价颇高的Search Engine Creator 不支持中文(等UTF-8);类似问题在找LaTeX编辑器的时候就碰到过了。

剩下的办法就是手动修改xml文件。
http://stackoverflow.com/questions/9963256/adding-a-custom-search-engine-to-firefox

使用XML Search Engines Exporter/Importer应该也行,下面似乎是不使用而修改xml的背后的操作?

 14down voteacceptedHere are the steps: 1) Need to create an xml file which will contain information about search engine like ShortName, Description, Url etc. Example of xml file: https://developer.mozilla.org/en/Creating_MozSearch_plugins2) Give a name to that xml file and put it here:"%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\searchplugins"or here:"%PROGRAM_FILES%\Mozilla Firefox\searchplugins"3) Modifying firefox preferences file:"%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\prefs.js"Simply add/modify this line:user_pref("browser.search.selectedEngine", "engine_name");No needing to modify sqlite database file manually. New search engine will be added automatically after restarting firefox.`>About this Add-onFirefox 45 changed how the search engines added by the user are stored in disk: instead of plain XML files, now a unique compressed and hashed file is used. It was in order to provide a better protection against search hijacking, but it made impossible to edit or even inspect the data of these engines to knowledgeable users; even adding a new search engine from the local file system became an awkward task.This lightweight add-on provides two features:• Let to export any of the existent search engines in Firefox to a XML file in the OpenSearch format.• Let to add to Firefox one or more search engines from local XML files in the same format. Both features are accessible from the Search pane of the Preferences page in Firefox (check the screenshots). No toolbar button or global keyboard shortcut is provided, for the moment.Combining these two tools provides a workaround for the impossibility of editing a search engine added to Firefox from a website (you will need to remove the exported engine from Firefox before importing it back).Note that it's not possible to have a customized search engine with the same name as one of the search engines included by default in Firefox, even if the latter was hidden; it's an intentional restriction of the application.Included localizations: English (en-US), español (es-ES).This add-on is in an early development stage; in case of apparent problems, check first the Browser Console of Firefox for related messages. It's recommended to do a backup of your search.json.mozlz4 file in your Firefox user profile if you have planned to do a lot of exports & imports of engines for editing purposes.Rated 5 out of 5 stars Average Rated 5 out of 5 stars 4 .Rated 4 out of 5 stars 0 .Rated 3 out of 5 stars 0 .Rated 2 out of 5 stars 0 .Rated 1 out of 5 stars 0 .Write a review Report Abuse ReviewsGreat idea! Rated 5 out of 5 stars by decembre on September 6, 2016 · permalink · translate It's a pain to edit our search engine, but you help us with this addon:thanks!Ps about Other helpful addon for organize Search engines:- Add to Search Bar:https://addons.mozilla.org/en-US/firefox/addon/add-to-search-bar/?src=collection&collection_id=4081dae0-cc25-4aab-aa38-7d581f003ab9- Context Search X :https://addons.mozilla.org/en-US/firefox/addon/context-search-x/?src=collection&collection_id=4081dae0-cc25-4aab-aa38-7d581f003ab9Must have! Rated 5 out of 5 stars by bege1 on September 1, 2016 · permalink · translate I don't know why the Mozilla developers didn't do this when they changed the search plugins format. The answer to my request in bugzilla directed me here. So this extension is a must have if you want to edit or add search plugins manually.Thank you very much for this work!Perfect! Rated 5 out of 5 stars by Orangutan on August 26, 2016 · permalink · translate Saves trips to the Browser Console and makes installing search engines a breeze. Thank you for making this.By any chance, would you know if there is a way to make non-standard search engines such as that for about:config? I tried importing one but that gave me an error. Show the developer's reply to this review »`

笨办法,比如找到google.xml文件,直接修改即可

<!-- This Source Code Form is subject to the terms of the Mozilla Public   - License, v. 2.0. If a copy of the MPL was not distributed with this   - file, You can obtain one at http://mozilla.org/MPL/2.0/. --><SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><ShortName>Google</ShortName><Description>Google Search</Description><InputEncoding>UTF-8</InputEncoding><Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABUUlEQVR42pWTzUsCYRCH9y9zu3SooCCkjhIRRLeIykXokiWCJ7PvDpZRlz6si1lIQZ3SQxQdOhREpgSm0JeQvfu0+i6I7LKLh4F5h5nnnRl+o6jTdHn8omAYbVqhXqvYFXcEBKFDwcoZZB8B4LkEB9cwGGmFKHb01A1EU9JXzfdvDYZi1lwLwBcVAIwsNWPesIwls7gDtB2Z7N9ujVe+IX2LO2AgItB1OL9vJqsmILDrOoK02IkBAdYy4FsQJC5h+VQCHQDWTqYSgo8fuHuRxS4Ae3stQ7UGE5ttAHqCUgfxC7m4ryrowOyeO6CxqHwZxtYFqtYc5+kNan/gDTsAeueEIRj7n/rmRQMwueUAGF0VAAT3rQBTC0Y3DoDOGbm00icML4oWHYSTgo0MFqjlmPpDgqMcFCuQf4erBzjOwXjcriu9qHg0uutO2+es6fl67T9ptebvFRjBVgAAAABJRU5ErkJggg==</Image><Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><Url type="text/html" method="GET" template="https://www.google.com.hk/search">  <Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>  <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/></Url><!-- Keyword search URL is the same as the default, but with an additional parameter --><Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com.hk/search">  <Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>  <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>  <Param name="channel" value="fflb"/></Url><!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com.hk/search">  <Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>  <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>  <Param name="channel" value="rcs"/></Url><SearchForm>https://www.google.com.hk/</SearchForm></SearchPlugin>

欢迎使用Markdown编辑器写博客

本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:

  • Markdown和扩展Markdown简洁的语法
  • 代码块高亮
  • 图片链接和图片上传
  • LaTex数学公式
  • UML序列图和流程图
  • 离线写博客
  • 导入导出Markdown文件
  • 丰富的快捷键

快捷键

  • 加粗 Ctrl + B
  • 斜体 Ctrl + I
  • 引用 Ctrl + Q
  • 插入链接 Ctrl + L
  • 插入代码 Ctrl + K
  • 插入图片 Ctrl + G
  • 提升标题 Ctrl + H
  • 有序列表 Ctrl + O
  • 无序列表 Ctrl + U
  • 横线 Ctrl + R
  • 撤销 Ctrl + Z
  • 重做 Ctrl + Y

Markdown及扩展

Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档,然后转换成格式丰富的HTML页面。 —— [ 维基百科 ]

使用简单的符号标识不同的标题,将某些文字标记为粗体或者斜体,创建一个链接等,详细语法参考帮助?。

本编辑器支持 Markdown Extra ,  扩展了很多好用的功能。具体请参考Github.

表格

Markdown Extra 表格语法:

项目 价格 Computer $1600 Phone $12 Pipe $1

可以使用冒号来定义对齐方式:

项目 价格 数量 Computer 1600 元 5 Phone 12 元 12 Pipe 1 元 234

定义列表

Markdown Extra 定义列表语法:
项目1
项目2
定义 A
定义 B
项目3
定义 C

定义 D

定义D内容

代码块

代码块语法遵循标准markdown代码,例如:

@requires_authorizationdef somefunc(param1='', param2=0):    '''A docstring'''    if param1 > param2: # interesting        print 'Greater'    return (param2 - param1 + 1) or Noneclass SomeClass:    pass>>> message = '''interpreter... prompt'''

脚注

生成一个脚注1.

目录

[TOC]来生成目录:

  • 欢迎使用Markdown编辑器写博客
    • 快捷键
    • Markdown及扩展
      • 表格
      • 定义列表
      • 代码块
      • 脚注
      • 目录
      • 数学公式
      • UML 图
    • 离线写博客
    • 浏览器兼容

数学公式

使用MathJax渲染LaTex 数学公式,详见math.stackexchange.com.

  • 行内公式,数学公式为:Γ(n)=(n1)!nN
  • 块级公式:

x=b±b24ac2a

更多LaTex语法请参考 这儿.

UML 图:

可以渲染序列图:

Created with Raphaël 2.1.0张三张三李四李四嘿,小四儿, 写博客了没?李四愣了一下,说:忙得吐血,哪有时间写。

或者流程图:

Created with Raphaël 2.1.0开始我的操作确认?结束yesno
  • 关于 序列图 语法,参考 这儿,
  • 关于 流程图 语法,参考 这儿.

离线写博客

即使用户在没有网络的情况下,也可以通过本编辑器离线写博客(直接在曾经使用过的浏览器中输入write.blog.csdn.net/mdeditor即可。Markdown编辑器使用浏览器离线存储将内容保存在本地。

用户写博客的过程中,内容实时保存在浏览器缓存中,在用户关闭浏览器或者其它异常情况下,内容不会丢失。用户再次打开浏览器时,会显示上次用户正在编辑的没有发表的内容。

博客发表后,本地缓存将被删除。 

用户可以选择 把正在写的博客保存到服务器草稿箱,即使换浏览器或者清除缓存,内容也不会丢失。

注意:虽然浏览器存储大部分时候都比较可靠,但为了您的数据安全,在联网后,请务必及时发表或者保存到服务器草稿箱

浏览器兼容

  1. 目前,本编辑器对Chrome浏览器支持最为完整。建议大家使用较新版本的Chrome。
  2. IE9以下不支持
  3. IE9,10,11存在以下问题
    1. 不支持离线功能
    2. IE9不支持文件导入导出
    3. IE10不支持拖拽文件导入


  1. 这里是 脚注内容. ↩
0 0
原创粉丝点击