|
阅读:5912回复:18
火狐量子v68 手动加入搜索引擎遇到些问题 找后援团求解图片:screenshot_292_02-5021.png 图片:screenshot_292_02-5022.png
图片:screenshot_292_02-5023.png 图片:screenshot_292_02-5026.png
图片:screenshot_292_02-4319.png
手动加入搜索引擎到omni.ja中, fx死活只能识别其中的3个... 难道json有问题? 仔细检查了的啊. 应该如何解决呢 PS 知道Add custom search engine, mozlz4-edit, 但出于使用习惯, 只想添加引擎到omni.ja中. |
|
|
1楼#
发布于:2019-11-29 23:09
|
|
|
2楼#
发布于:2019-11-29 22:12
alanfly:我用这个脚本导入的,可以批量导入xml格式的搜索引擎。兄弟, 打不开 |
|
|
3楼#
发布于:2019-08-02 13:33
mark
|
|
|
4楼#
发布于:2019-07-27 17:01
kmc:我投奔Waterfox了。新的Waterfox Alpha我还没怎么测试。回到原帖waterfox 我也在用, logo好评 :P waterfox实际使用也并不理想, 向上无法兼容imagus v0.9.8.52以上版本, 向下不兼容vimperator, 感觉目前自己说的好听, 实际效果不怎理想, 所以对我来说只是摆设, 平时主要还是在52esr上晃悠, 56都用的也少, 因vimp不兼容. 最近v68修复了很多以前版本上存在的问题, 打算部分迁移, 为此导入了200个搜索引擎(但"about:config?filter={searchTerms}"加入, 还不知怎么办), 遗憾的是只能依靠敲热键切换引擎搜索, 而没办法按组批量搜索... |
|
|
5楼#
发布于:2019-07-26 20:27
|
|
|
|
6楼#
发布于:2019-07-24 23:50
|
|
|
7楼#
发布于:2019-07-21 07:55
|
|
|
|
8楼#
发布于:2019-07-19 22:24
lonely_8:FF 版本得 67 或以上。这个也改了后正常了,可以批量导入。 感谢。
发个完整的修改好的。 // -sp-context: browser
/* 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/.
*
*
* xseei.import.js
* ===============
* code-revision 2
* https://gist.github.com/nohamelin/8e2e1b50dc7d97044992ae981487c6ec
*
* ABOUT
* -----
* It's a minimal no-configurable no-localized single-file re-package of the
* "Import Search Engines from local OpenSearch XML File(s)" feature of the
* "XML Search Engines Exporter/Importer" (XSEEI) legacy add-on for Mozilla
* Firefox:
* https://addons.mozilla.org/firefox/addon/search-engines-export-import/
*
* ...to be used in those Firefox builds not supporting anymore legacy add-ons
* (i.e. Firefox 57 and later versions), where the unique system available
* to create extensions (called "WebExtensions") doesn't let to implement this
* functionality.
* As a bonus, it supports Gecko-comparable releases of the SeaMonkey suite
* too, that did not receive any official compatible release of the add-on.
*
* COMPATIBILITY
* -------------
* It has been checked to work with:
* - Firefox 57 to 64
* - Firefox ESR 60.0
* - SeaMonkey 2.49.1
*
* HOW TO RUN
* ----------
* It's expected to be run via the Javascript Scratchpad tool:
* https://developer.mozilla.org/en-US/docs/Tools/Scratchpad
*
* 1) Ensure you have enabled "Enable browser chrome and add-on debugging
* toolboxes" in the Developer Tools settings, or, alternatively, ensure
* that the preference *devtools.chrome.enabled* is true in about:config.
*
* 2) Open a *stand-alone* Scratchpad window, either using the Shift+F4
* keyboard shortcut or from the Web Developer submenu of the main
* Firefox menu.
* Using the embedded Scratchpad tab in the developer toolbox is NOT
* recommended: its behaviour is dependent of the type of content open
* in the active browser tab (web content will make this script to fail).
*
* 3) Use the "Open File..." command in the Scratchpad to load this file.
* A "This scratchpad executes in the Browser context" warning should be
* shown on top of the contents of the file. Otherwise, go to the
* "Environment" menu and ensure that "Browser" is selected.
*
* 4) Make sure there is no selected text in the editor, and use the command
* "Run". A file dialog will be open, to select one or more XML files in
* the OpenSearch format to be selected. After picking them, a Javascript
* dialog will be shown to confirm you the successful importing task.
* Otherwise, check the Browser Console by any related error messages.
*
* CONTACT
* -------
* You can use any of the provided support channels for the source add-on:
* https://github.com/nohamelin/xseei
* http://forums.mozillazine.org/viewtopic.php?f=48&t=3020165
*
* SEE ALSO
* --------
* xseei.export-all.js:
* https://gist.github.com/nohamelin/6af8907ca2dd90a9c870629c396c9521
*/
(function() {
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
function importEnginesFromFiles() {
let fp = Cc["@mozilla.org/filepicker;1"]
.createInstance(Ci.nsIFilePicker);
fp.init(window,
"Select XML Search Engine Files",
Ci.nsIFilePicker.modeOpenMultiple);
fp.appendFilters(Ci.nsIFilePicker.filterXML);
fp.open({
done: result => {
if (result === Ci.nsIFilePicker.returnCancel)
return;
let xmlFiles = [];
let files = fp.files;
while (files.hasMoreElements()) {
let file = files.getNext().QueryInterface(Ci.nsIFile);
xmlFiles.push(file);
}
let importedEngines = [];
// The use of this empty promise lets us to run sequentially
// a group of promises, one for each engine. This process is
// not stopped if one or more promises are rejected in between.
let sequence = Promise.resolve();
xmlFiles.forEach(file => {
sequence = sequence.then(() => {
return addEngineFromXmlFile(file);
}).then(engine => {
importedEngines.push(engine);
}).catch(err => { // Each engine is reported separately
Cu.reportError(
"Import of a search engine from the file '" +
file.leafName + "' failed: " + err.message || err);
});
});
sequence.then(() => {
if (importedEngines.length > 0) {
if (xmlFiles.length === importedEngines.length) {
alert("Successful import");
} else {
alert(importedEngines.length + " of " + xmlFiles.length
+ " import tasks were successful");
}
}
}).catch(Cu.reportError);
}
});
}
function addEngineFromXmlFile(file) {
return new Promise((resolve, reject) => {
let uri = OS.Path.toFileURI(file.path);
let searchInstallCallback = {
onSuccess: engine => {
resolve(engine);
},
onError: errorCode => {
switch (errorCode) {
case Ci.nsISearchService.ERROR_DUPLICATE_ENGINE:
reject(Error("a search engine with the included " +
"name already exists"));
break;
case Ci.nsISearchService.ERROR_UNKNOWN_FAILURE:
default:
reject(Error("unknown error"));
break;
}
}
};
try {
Services.search.addEngine(uri,
Ci.nsISearchEngine.DATA_XML,
"", // iconURL
false, // confirm
).then(searchInstallCallback.onSuccess, searchInstallCallback.onError);
} catch (e) {
// Try again without type parameter for Firefox 64+ (bug 1481199)
Services.search.addEngine(uri,
"", // iconURL
false, // confirm
).then(searchInstallCallback.onSuccess, searchInstallCallback.onError);
}
});
}
// Run
importEnginesFromFiles();
})(); |
|
|
9楼#
发布于:2019-07-19 21:34
|
|
|
10楼#
发布于:2019-07-19 21:00
lonely_8:将脚本中的改了后导入失效了。 try {
Services.search.addEngine(uri,
Ci.nsISearchEngine.DATA_XML,
"", // iconURL
false, // confirm
).then(searchInstallCallback.onSuccess, searchInstallCallback.onError);
} catch (e) {
// Try again without type parameter for Firefox 64+ (bug 1481199)
Services.search.addEngine(uri,
"", // iconURL
false, // confirm
).then(searchInstallCallback.onSuccess, searchInstallCallback.onError); |
|
|
11楼#
发布于:2019-07-19 20:17
|
|
|
12楼#
发布于:2019-07-19 19:55
|
|
|
13楼#
发布于:2019-07-19 19:08
|
|
|
14楼#
发布于:2019-07-18 17:58
|
|
上一页
下一页
