Skript bookmarks_backup_restore_buttons.uc.js #109
milupo
started this conversation in
Show and tell
Replies: 1 comment
-
Sorry, I forgot to say thanks and to to upload the new file. Thanks again. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Aris,
in forum camp-firefox a member has told that the above mentioned script did not work anymore. There in post #15, member BrokenHeart found a solution. Your script version still imports three jsm-files but there are not jsm-files anymore, only sys.mjs. But it tourned out that this import is not necessary. Here is my version:
`// Bookmarks Backup/Restore button script for Firefox 60+ by Aris
(function() {
try {
//ChromeUtils.importESModule("resource:///modules/CustomizableUI.sys.mjs");
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var RESTORE_FILEPICKER_FILTER_EXT = ".json;.jsonlz4";
CustomizableUI.createWidget({
id: "uc-bookmarks_backup", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Bookmarks Backup", // button title
tooltiptext: "Bookmarks Backup", // tooltip title
onClick: function(event) {
});
CustomizableUI.createWidget({
id: "uc-bookmarks_restore", // button id
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Bookmarks Restore", // button title
tooltiptext: "Bookmarks Restore", // tooltip title
onClick: function(event) {
});
// style button icon
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('
#uc-bookmarks_backup .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/bookmark.svg"); /* icon / path to icon /
fill: red; / icon color name/code /
}
#uc-bookmarks_restore .toolbarbutton-icon {
list-style-image: url("chrome://browser/skin/bookmark.svg"); / icon / path to icon /
fill: green; / icon color name/code */
}
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch (e) {
Components.utils.reportError(e);
};
})();`
I deleted the three import lines and additionally those for the import of customizeableUI.jsm and services.jsm. The change of BrokenHeart is in the lines 29 and 86 (in your script version lines 35 and 92):
fp.init(BrowsingContext.getFromWindow(window), "json",
instead offp.init(window, "json",
Beta Was this translation helpful? Give feedback.
All reactions