Reset original value about:config firefox via javascript or imacros
I need to reset value in Firefox about:config with Javascript or imacros.
I found Javascript code that is compatible with imacros to set value in about:config via Javascript.
To set the value in about:config I use this code:
iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("pdfjs.disabled", true);
prefs.setIntPref("browser.download.folderList", 2);
prefs.setCharPref("browser.download.dir", "C:\");
Now I want to know if there exists a similar solution to reset the value to return with original values.
Thanks
javascript firefox reset imacros
add a comment |
I need to reset value in Firefox about:config with Javascript or imacros.
I found Javascript code that is compatible with imacros to set value in about:config via Javascript.
To set the value in about:config I use this code:
iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("pdfjs.disabled", true);
prefs.setIntPref("browser.download.folderList", 2);
prefs.setCharPref("browser.download.dir", "C:\");
Now I want to know if there exists a similar solution to reset the value to return with original values.
Thanks
javascript firefox reset imacros
add a comment |
I need to reset value in Firefox about:config with Javascript or imacros.
I found Javascript code that is compatible with imacros to set value in about:config via Javascript.
To set the value in about:config I use this code:
iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("pdfjs.disabled", true);
prefs.setIntPref("browser.download.folderList", 2);
prefs.setCharPref("browser.download.dir", "C:\");
Now I want to know if there exists a similar solution to reset the value to return with original values.
Thanks
javascript firefox reset imacros
I need to reset value in Firefox about:config with Javascript or imacros.
I found Javascript code that is compatible with imacros to set value in about:config via Javascript.
To set the value in about:config I use this code:
iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.setBoolPref("pdfjs.disabled", true);
prefs.setIntPref("browser.download.folderList", 2);
prefs.setCharPref("browser.download.dir", "C:\");
Now I want to know if there exists a similar solution to reset the value to return with original values.
Thanks
javascript firefox reset imacros
javascript firefox reset imacros
edited Nov 24 '18 at 21:25
Robert
2,15062535
2,15062535
asked Nov 23 '18 at 16:01
placidomaioplacidomaio
447
447
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Let me describe the idea below:
// This part is unnecessary
// iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var originalValue = prefs.getCharPref("browser.download.dir");
prefs.setCharPref("browser.download.dir", "C:\");
// do something useful here
prefs.setCharPref("browser.download.dir", originalValue);
Hope my code is clear enough.
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
add a comment |
The solution is this
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.clearUserPref("layout.css.devPixelsPerPx");
prefs.clearUserPref is the code to reset firefox about:config value change "layout.css.devPixelsPerPx" with the voice to reset.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449756%2freset-original-value-aboutconfig-firefox-via-javascript-or-imacros%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Let me describe the idea below:
// This part is unnecessary
// iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var originalValue = prefs.getCharPref("browser.download.dir");
prefs.setCharPref("browser.download.dir", "C:\");
// do something useful here
prefs.setCharPref("browser.download.dir", originalValue);
Hope my code is clear enough.
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
add a comment |
Let me describe the idea below:
// This part is unnecessary
// iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var originalValue = prefs.getCharPref("browser.download.dir");
prefs.setCharPref("browser.download.dir", "C:\");
// do something useful here
prefs.setCharPref("browser.download.dir", originalValue);
Hope my code is clear enough.
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
add a comment |
Let me describe the idea below:
// This part is unnecessary
// iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var originalValue = prefs.getCharPref("browser.download.dir");
prefs.setCharPref("browser.download.dir", "C:\");
// do something useful here
prefs.setCharPref("browser.download.dir", originalValue);
Hope my code is clear enough.
Let me describe the idea below:
// This part is unnecessary
// iimPlayCode("URL GOTO=about:confign WAIT SECONDS=1");
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var originalValue = prefs.getCharPref("browser.download.dir");
prefs.setCharPref("browser.download.dir", "C:\");
// do something useful here
prefs.setCharPref("browser.download.dir", originalValue);
Hope my code is clear enough.
answered Nov 24 '18 at 19:16
ShugarShugar
4,904159
4,904159
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
add a comment |
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
This solution don't solve the problem because to set some value in about:config necessary to add a string and to be return to original value need to be reset this value. This is an example: to edit oscpu on firefox must use this command prefs.setCharPref("general.oscpu.override", "Linux"); but to remove this customization is necessary to reset "general.oscpu.override" and after restarting firefox "general.oscpu.override" wll be deleted automatically from firefox and the settings return with original values. With prefs.setCharPref you can add/edit value but not reset value. Thanks for your idea
– placidomaio
Nov 25 '18 at 20:51
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
I tryed to edit the value with a blank value example prefs.setCharPref("general.oscpu.override", ""); but this do not reset the value and after restarting firefox do not remove the value "general.oscpu.override" and remain setted cpu without value "" not with original default value extracted from the pc. Some values in about:config will be calculate automatically and can edit adding string like "general.oscpu.override" and to return original value need to reset and the the "override" string added.
– placidomaio
Nov 25 '18 at 21:11
add a comment |
The solution is this
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.clearUserPref("layout.css.devPixelsPerPx");
prefs.clearUserPref is the code to reset firefox about:config value change "layout.css.devPixelsPerPx" with the voice to reset.
add a comment |
The solution is this
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.clearUserPref("layout.css.devPixelsPerPx");
prefs.clearUserPref is the code to reset firefox about:config value change "layout.css.devPixelsPerPx" with the voice to reset.
add a comment |
The solution is this
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.clearUserPref("layout.css.devPixelsPerPx");
prefs.clearUserPref is the code to reset firefox about:config value change "layout.css.devPixelsPerPx" with the voice to reset.
The solution is this
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
prefs.clearUserPref("layout.css.devPixelsPerPx");
prefs.clearUserPref is the code to reset firefox about:config value change "layout.css.devPixelsPerPx" with the voice to reset.
answered Nov 28 '18 at 20:01
placidomaioplacidomaio
447
447
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449756%2freset-original-value-aboutconfig-firefox-via-javascript-or-imacros%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown