keyconfig 20110522
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
I spoke to soon. It seems like this code runs once for every window. So the tabbar only gets hidden if I have an odd number of windows. With even numbe of windows the tabbar ends up gettings shown.
Also, I often see the tabbar being hidden shown and hidden again while windows are opened on startup.
PS:
I also added the code to the mozilla config as per original instructions: it works the same way.
Also, I often see the tabbar being hidden shown and hidden again while windows are opened on startup.
PS:
I also added the code to the mozilla config as per original instructions: it works the same way.
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
Try something like the following code snippet to run once per session.
You may have to create an about:config preference or use pure javascript to hide the tabs toolbar.
Try something like the following code snippet to run once per session.
Code: Select all
(function () {
var uid = "__unique_identifier_style_sheet_example";
if (!(uid in window)) {
var css = [];
css.push("#TabsToolbar { visibility: collapse !important; }");
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI("data:text/css," + encodeURIComponent(css.join("\n")), null, null);
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].
getService(Components.interfaces.nsIStyleSheetService);
if (sss.sheetRegistered(uri, sss.USER_SHEET)) {
sss.unregisterSheet(uri, sss.USER_SHEET);
} else {
sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
}
window[uid] = true;
}
})();
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
How do I get it to run once only?
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
Answer: http://forums.mozillazine.org/viewtopic ... #p14896201
You have a habit of asking the same questions.
Answer: http://forums.mozillazine.org/viewtopic ... #p14896201
You have a habit of asking the same questions.
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
Hi!
I have this code to download with yt-dlp, and to see the errors if ther are any:
And it works fine, unless there are characters in the url that are not handled right. In which case I get errors. For example.
This is the commands that was run:
The dowload seems to complete successfully in this case, But I got errors like this at the end:
I'm guessing it's because the & characters in the url and maybe because the parameters are passed twice. I just have no clue how to prevent this error. And sometimes these parts after the & characters of the url matter. (In this case, if I tried to download the whole playlist)
Any ideas?
I have this code to download with yt-dlp, and to see the errors if ther are any:
Code: Select all
/*Code*/
var uid = "__unique_identifier_" + this.id;
var script = "data:text/plain," + encodeURIComponent(`
var data = {};
data.href = content.location.href;
sendAsyncMessage("${uid}", data);
`);
gBrowser.selectedBrowser.messageManager.addMessageListener(uid, function listener(message) {
gBrowser.selectedBrowser.messageManager.removeMessageListener(uid, listener);
var url = message.data.href;
var localFile = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsIFile);
var process = Components.classes["@mozilla.org/process/util;1"].
createInstance(Components.interfaces.nsIProcess);
var args = ["/k", "D:\\Programok\\videó\\CLI\\youtube-dl.exe", "--no-playlist", "-o", "D:\\Letöltés\\%(title)s.%(ext)s", url];
localFile.initWithPath("c:\\Windows\\System32\\cmd.exe");
process.init(localFile);
process.run(false, args, args.length);
});
gBrowser.selectedBrowser.messageManager.loadFrameScript(script, false);
This is the commands that was run:
Code: Select all
"C:\Windows\System32\cmd.exe" /k D:\Programok\videó\CLI\youtube-dl.exe --no-playlist -o D:\Letöltés\%(title)s.%(ext)s https://www.youtube.com/watch?v=4RhOKdaREK0&list=PLpZox6Cvj7bX9QA-37DQKw9rC8SnDxNUf&index=7
Code: Select all
'list' is not recognized as an internal or external command,
operable program or batch file.
'index' is not recognized as an internal or external command,
operable program or batch file.
Any ideas?
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
Try using "process.runw" instead of "process.run".
Try quoting the youtube url.
Similar thread
http://custombuttons.sourceforge.net/fo ... 743#p88743
Maybe you could prune the youtube url. Remove the list and index sections.
Try using "process.runw" instead of "process.run".
Try quoting the youtube url.
Similar thread
http://custombuttons.sourceforge.net/fo ... 743#p88743
Maybe you could prune the youtube url. Remove the list and index sections.
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
Never could figure out how to append quotes and save it in the url variable.morat wrote:@avada
Try using "process.runw" instead of "process.run".
Try quoting the youtube url.
Similar thread
http://custombuttons.sourceforge.net/fo ... 743#p88743
Maybe you could prune the youtube url. Remove the list and index sections.
I also have a button to download playlists, where removing those parts is not possible. Even if I knew how to do it.
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
I got it working with yt-dlp_x86.exe on Windows 10 32-bit.
Test page
http://www.youtube.com/watch?v=7Vy8970q ... n2&index=1
The & is used to separate commands in the cmd.exe window. Therefore, you can use the ^ to escape the &.
More info
http://stackoverflow.com/questions/1327431
I got it working with yt-dlp_x86.exe on Windows 10 32-bit.
Test page
http://www.youtube.com/watch?v=7Vy8970q ... n2&index=1
Code: Select all
D:\Applications\Media\YouTube\yt-dlp_x86.exe --no-playlist -o "E:\test\%(title)s.%(ext)s" "https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2&index=1"
Code: Select all
(function () {
var url = "https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2&index=1";
url = url.replace(/&/g, "^&");
var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsIFile);
var process = Components.classes["@mozilla.org/process/util;1"].
createInstance(Components.interfaces.nsIProcess);
var args = ["/k", "D:\\Applications\\Media\\YouTube\\yt-dlp_x86.exe", "--no-playlist", "-o", "E:\\test\\%(title)s.%(ext)s", url];
file.initWithPath("C:\\Windows\\System32\\cmd.exe");
process.init(file);
process.run(false, args, args.length);
})();
More info
http://stackoverflow.com/questions/1327431
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
Thanks!morat wrote:@avada
I got it working with yt-dlp_x86.exe on Windows 10 32-bit.
Test page
http://www.youtube.com/watch?v=7Vy8970q ... n2&index=1
Code: Select all
D:\Applications\Media\YouTube\yt-dlp_x86.exe --no-playlist -o "E:\test\%(title)s.%(ext)s" "https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2&index=1"
The & is used to separate commands in the cmd.exe window. Therefore, you can use the ^ to escape the &.Code: Select all
(function () { var url = "https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2&index=1"; url = url.replace(/&/g, "^&"); var file = Components.classes["@mozilla.org/file/local;1"]. createInstance(Components.interfaces.nsIFile); var process = Components.classes["@mozilla.org/process/util;1"]. createInstance(Components.interfaces.nsIProcess); var args = ["/k", "D:\\Applications\\Media\\YouTube\\yt-dlp_x86.exe", "--no-playlist", "-o", "E:\\test\\%(title)s.%(ext)s", url]; file.initWithPath("C:\\Windows\\System32\\cmd.exe"); process.init(file); process.run(false, args, args.length); })();
More info
http://stackoverflow.com/questions/1327431
Didn't think the solution would be as simple as adding a single line that adds ^ characters.
-
- Posts: 153
- Joined: January 23rd, 2009, 9:14 pm
- Location: Germany
Re: keyconfig 20110522
Hello,
how must I edit this function to truly delete the messages instead of moving them to (local) trash?
how must I edit this function to truly delete the messages instead of moving them to (local) trash?
Code: Select all
"alt+shift+p": "(function () {
var targetUri = 'mailbox://nobody@Local%20Folders/Trash/GMX';
var sourceUri = 'imap://myaccount@imap.gmx.net/Gel&APY-scht';
var targetFolder = window.MailUtils.getExistingFolder(targetUri);
var sourceFolder = window.MailUtils.getExistingFolder(sourceUri);
window.gFolderTreeView.selectFolder(sourceFolder);
window.goDoCommand('cmd_selectAll');
window.MsgMoveMessage(targetFolder); })();",
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@bege
Delete commands:
* Delete - Delete message
* Shift + Delete - Delete message bypassing trash (no undo)
Thunderbird keyboard shortcuts
http://support.mozilla.org/kb/keyboard- ... hunderbird
Delete commands:
Code: Select all
goDoCommand('cmd_delete');
Code: Select all
goDoCommand('cmd_shiftDelete');
* Shift + Delete - Delete message bypassing trash (no undo)
Thunderbird keyboard shortcuts
http://support.mozilla.org/kb/keyboard- ... hunderbird
-
- Posts: 153
- Joined: January 23rd, 2009, 9:14 pm
- Location: Germany
Re: keyconfig 20110522
@morat
Thank you very much!
The result:
Thank you very much!
The result:
Code: Select all
"alt+shift+s": "(function () {
var sourceUri = 'imap://myaccount@imap.gmx.net/Spamverdacht';
var sourceFolder = window.MailUtils.getExistingFolder(sourceUri);
window.gFolderTreeView.selectFolder(sourceFolder);
window.goDoCommand('cmd_selectAll');
window.goDoCommand('cmd_shiftDelete'); })();"
-
- Posts: 2
- Joined: July 6th, 2023, 7:47 am
Re: keyconfig 20110522
Hello,
I am trying to redefine some default shortcuts, currently struggling to get the scroll commands (arrow keys), I searched in the browser toolbox but found nothing, it seems hard-coded in the omni.ja file.
Someone asked the same question in the past but it is way outdated.
EDIT: Solved, found this masterpiece
I am also trying to completely clear input focus when pressing Esc key, would be glad to get an answer on this aswell...
Thanks
I am trying to redefine some default shortcuts, currently struggling to get the scroll commands (arrow keys), I searched in the browser toolbox but found nothing, it seems hard-coded in the omni.ja file.
Someone asked the same question in the past but it is way outdated.
EDIT: Solved, found this masterpiece
I am also trying to completely clear input focus when pressing Esc key, would be glad to get an answer on this aswell...
Thanks
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@PlodPointer
Here is how to run the scrollBy method in the content window.
scrollBy
http://developer.mozilla.org/docs/Web/A ... w/scrollBy
Here is how to run the scrollBy method in the content window.
Code: Select all
gBrowser.selectedBrowser.messageManager.loadFrameScript("data:,content.scrollBy(0, 100)", false);
http://developer.mozilla.org/docs/Web/A ... w/scrollBy
Try these:PlodPointer wrote:clear input focus
Code: Select all
document.activeElement.blur(); // unfocus active element
Code: Select all
document.commandDispatcher.focusedElement.blur(); // unfocus focused element
Code: Select all
goDoCommand("cmd_selectAll"); goDoCommand("cmd_delete"); // clear
-
- Posts: 2
- Joined: July 6th, 2023, 7:47 am
Re: keyconfig 20110522
@morat Thank you for your answer!
I successfully removed focus on inputs using document.activeElement.blur(), but it is not working when trying to leave URL bar focus, it seems there is a bug since years about that one.
Do you know how can I manipulate the web page DOM through autoconfig? I am trying to focus inputs with a shortcut, but I can't access elements, only the browser ones.
It currently lacks documentation, or at best outdated most of the time, where can I find some about autoconfig? (I am digging into searchfox.org at the moment).
Thank you for your help.
I successfully removed focus on inputs using document.activeElement.blur(), but it is not working when trying to leave URL bar focus, it seems there is a bug since years about that one.
Do you know how can I manipulate the web page DOM through autoconfig? I am trying to focus inputs with a shortcut, but I can't access elements, only the browser ones.
It currently lacks documentation, or at best outdated most of the time, where can I find some about autoconfig? (I am digging into searchfox.org at the moment).
Thank you for your help.