"Show remote content" hotkey?
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
"Show remote content" hotkey?
Dear friends,
I'd like to set up a hotkey for the "Show remote content" command, so that when I open a Message I can quickly active the remote images and so on (but only when and if I want). I already use with satisfaction the Exceptions in the list of the addresses from which to regularly show the remote content, but here I am referring to e-mails from occasional addresses, not saved in my Address Book.
And I still want that the default behavior is not to show them; only if I wish, and with a hotkey.
I mean, maybe using the Keyconfig addon, for example. But I need to know how to express the command in terms of CODE:
Thanks!
I'd like to set up a hotkey for the "Show remote content" command, so that when I open a Message I can quickly active the remote images and so on (but only when and if I want). I already use with satisfaction the Exceptions in the list of the addresses from which to regularly show the remote content, but here I am referring to e-mails from occasional addresses, not saved in my Address Book.
And I still want that the default behavior is not to show them; only if I wish, and with a hotkey.
I mean, maybe using the Keyconfig addon, for example. But I need to know how to express the command in terms of CODE:
Thanks!
- DanRaisch
- Moderator
- Posts: 127240
- Joined: September 23rd, 2004, 8:57 pm
- Location: Somewhere on the right coast
Re: "Show remote content" hotkey?
Moving to Thunderbird Support.
-
- Posts: 6432
- Joined: February 3rd, 2009, 6:29 pm
Re: "Show remote content" hotkey?
Try this:
* toggle "Show remote content for this message"
* toggle "Show remote content for this message"
Code: Select all
var kNoRemoteContentPolicy = 0;
var kBlockRemoteContent = 1;
var kAllowRemoteContent = 2;
var msgHdr = gMessageDisplay.displayedMessage;
if (msgHdr) {
var remoteContentPolicy = msgHdr.getUint32Property("remoteContentPolicy");
if (remoteContentPolicy == kBlockRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kAllowRemoteContent);
} else if (remoteContentPolicy == kAllowRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kNoRemoteContentPolicy);
}
window.content.focus();
}
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
Re: "Show remote content" hotkey?
Thank you morat for the suggestion. But, unfortunately, I can't apply it properly, and maybe I made a mistake somewhere.
Now all the messages show remote content by default, even if in the general Options I unchecked the related box.
So maybe I modified, using your command, somewhat in the "deep" configuration of the variables.
How to reset to fabric values, in order to try alternatives or make other attempts?
***
Isn't there a method to edit the Thunderbird general hotkeys without keyconfig? In fact, I currently hardly understand how it works precisely.
Again thanks.
Now all the messages show remote content by default, even if in the general Options I unchecked the related box.
So maybe I modified, using your command, somewhat in the "deep" configuration of the variables.
How to reset to fabric values, in order to try alternatives or make other attempts?
***
Isn't there a method to edit the Thunderbird general hotkeys without keyconfig? In fact, I currently hardly understand how it works precisely.
Again thanks.
-
- Posts: 6432
- Joined: February 3rd, 2009, 6:29 pm
Re: "Show remote content" hotkey?
Do you know how to create a keyboard shortcut with the keyconfig extension? I can post instructions if you want.
The code changes the remoteContentPolicy property in the mail summary file (*.msf) for the selected message. It does not change "all the messages".
What version of Thunderbird are you using? I am assuming you are using the release build.
The code changes the remoteContentPolicy property in the mail summary file (*.msf) for the selected message. It does not change "all the messages".
What version of Thunderbird are you using? I am assuming you are using the release build.
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
Re: "Show remote content" hotkey?
Thank you morat, very kind from you this help.
Your right, some other instructions about Keyconfig will be useful. In fact, maybe I'm not so expert in creating a shortcut with Keyconfig.
For example, I can't understand so well:
Your right, some other instructions about Keyconfig will be useful. In fact, maybe I'm not so expert in creating a shortcut with Keyconfig.
For example, I can't understand so well:
- The meaning of the checkbox "Global";
- When I want to add a new shortkey, in the upper part of the window I find listed all the other windows currently opened: what to select?;
-
- Posts: 6432
- Joined: February 3rd, 2009, 6:29 pm
Re: "Show remote content" hotkey?
Instructions:
1. install extension and restart
http://mozilla.dorando.at/keyconfig.xpi
2. tools > keyconfig
3. select a window in the dropdown window list
4. add a new key
5. type a command in the /* CODE */ box, e.g. alert("test");
6. type a shortcut in the <Disabled> box, e.g. Ctrl+Shift+!
7. apply
8. close
The shortcuts are stored as preferences. You can use the search bar at the top of the about:config window to filter the preferences that you want to reset.
Search: keyconfig.main.
You can also reset the shortcuts in the keyconfig dialog.
You need to restart after resetting shortcuts.
http://forums.mozillazine.org/viewtopic.php?f=48&t=72994
Here are two examples that alert the chrome url when using the shortcut.
Example 1)
Create a ctrl+shift+1 shortcut with the global option checked.
Example 2)
Create a ctrl+shift+2 shortcut with the global option unchecked.
Example 1 works in all windows.
Example 2 works in only the selected window.
Here is a list of common chrome urls.
3pane window > chrome://messenger/content/messenger.xul
message window > chrome://messenger/content/messageWindow.xul
compose window > chrome://messenger/content/messengercompose/messengercompose.xul
address book window > chrome://messenger/content/addressbook/addressbook.xul
keyconfig window > chrome://keyconfig/content/keyconfig.xul
prompt window > chrome://global/content/commonDialog.xul
The 1st window in the dropdown list is the 3pane window.
The 2nd window in the dropdown list is likely the message window.
The 3rd window in the dropdown list is the keyconfig window.
You should select the window you want the shortcut to work in.
1. install extension and restart
http://mozilla.dorando.at/keyconfig.xpi
2. tools > keyconfig
3. select a window in the dropdown window list
4. add a new key
5. type a command in the /* CODE */ box, e.g. alert("test");
6. type a shortcut in the <Disabled> box, e.g. Ctrl+Shift+!
7. apply
8. close
The shortcuts are stored as preferences. You can use the search bar at the top of the about:config window to filter the preferences that you want to reset.
Search: keyconfig.main.
You can also reset the shortcuts in the keyconfig dialog.
You need to restart after resetting shortcuts.
http://forums.mozillazine.org/viewtopic.php?f=48&t=72994
Michele_BS wrote:meaning of the checkbox "Global"
Here are two examples that alert the chrome url when using the shortcut.
Example 1)
Create a ctrl+shift+1 shortcut with the global option checked.
Code: Select all
Services.prompt.alert(null, "Example 1", document.location.href);
Example 2)
Create a ctrl+shift+2 shortcut with the global option unchecked.
Code: Select all
Services.prompt.alert(null, "Example 2", document.location.href);
Example 1 works in all windows.
Example 2 works in only the selected window.
Here is a list of common chrome urls.
3pane window > chrome://messenger/content/messenger.xul
message window > chrome://messenger/content/messageWindow.xul
compose window > chrome://messenger/content/messengercompose/messengercompose.xul
address book window > chrome://messenger/content/addressbook/addressbook.xul
keyconfig window > chrome://keyconfig/content/keyconfig.xul
prompt window > chrome://global/content/commonDialog.xul
Michele_BS wrote:When I want to add a new shortkey, in the upper part of the window I find listed all the other windows currently opened: what to select?
The 1st window in the dropdown list is the 3pane window.
The 2nd window in the dropdown list is likely the message window.
The 3rd window in the dropdown list is the keyconfig window.
You should select the window you want the shortcut to work in.
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
Re: "Show remote content" hotkey?
Morat,
your instructions were clear. I learned and applied: all works perfectly, now, exactly as I desired!
I set up "C" as shortcut with your code, checking "Global". Now if I press "C" in a "clouded" message, the images and other remote content appear. And if I press "C" again, instead, the content turns off as it originally was.
Great help from you: thanks.
***
But, I wonder, is there any way to switch this toggle "active/inactive" from the menu? I can't find this command anyway.
your instructions were clear. I learned and applied: all works perfectly, now, exactly as I desired!
I set up "C" as shortcut with your code, checking "Global". Now if I press "C" in a "clouded" message, the images and other remote content appear. And if I press "C" again, instead, the content turns off as it originally was.
Great help from you: thanks.
***
But, I wonder, is there any way to switch this toggle "active/inactive" from the menu? I can't find this command anyway.
-
- Posts: 6432
- Joined: February 3rd, 2009, 6:29 pm
Re: "Show remote content" hotkey?
You're welcome.
There is no standard way to undo the "Show remote content in this message" command.
viewtopic.php?p=13739663#p13739663
Michele_BS wrote:any way to switch this... from the menu?
There is no standard way to undo the "Show remote content in this message" command.
viewtopic.php?p=13739663#p13739663
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
Re: "Show remote content" hotkey?
...how delightful to press "C" and "C" again a lot of times, and to see the remote content appearing and disappearing all the times I want...
It's beautiful to feel all this mastery with the software. Gratifying.
***
p.s. "C" is the shortcut I chose
It's beautiful to feel all this mastery with the software. Gratifying.
***
p.s. "C" is the shortcut I chose
-
- Posts: 1
- Joined: August 12th, 2010, 12:17 pm
Re: "Show remote content" hotkey?
Sorry for my newbie question but how do you install this to Thunderbird?
- LIMPET235
- Moderator
- Posts: 39961
- Joined: October 19th, 2007, 1:53 am
- Location: The South Coast of N.S.W. Oz.
Re: "Show remote content" hotkey?
Hi, Right click & Save Link as....to wherever you desire.
Then drag 'n' drop the .xpi file into Thunderbird's Addons screen.
Close & re-open to complete.
(I'm leaving this open, even though it's rather old.)
Then drag 'n' drop the .xpi file into Thunderbird's Addons screen.
Close & re-open to complete.
(I'm leaving this open, even though it's rather old.)
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.
(Always choose the "Custom" Install.)
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.
(Always choose the "Custom" Install.)
-
- Posts: 86
- Joined: May 11th, 2012, 11:14 am
Re: "Show remote content" hotkey?
Dear users,
unluckily, dorando keyconfig isn't supported anymore (Thunderbird 68+). On the keyconfig forum, It was suggested to me to try tbkeys as an alternative to keyconfig.
So I am trying to create again, here in tbkeys, a hotkey to toggle hide/view the remote content in my messages (this is so useful, for me!).
But I don't know if the keyconfig code that morat provided me several years ago, just here in this thread, can be applied also to tbkeys.
Tbkeys is based on a little textfile (with json syntax, I think) where all the hotkeys are listed. Here is, for example, the custom ones:
How can I adapt the excellent morat code (quoted below) to tbkeys, in order to assign the command to the "c" key?
Thanks.
unluckily, dorando keyconfig isn't supported anymore (Thunderbird 68+). On the keyconfig forum, It was suggested to me to try tbkeys as an alternative to keyconfig.
So I am trying to create again, here in tbkeys, a hotkey to toggle hide/view the remote content in my messages (this is so useful, for me!).
But I don't know if the keyconfig code that morat provided me several years ago, just here in this thread, can be applied also to tbkeys.
Tbkeys is based on a little textfile (with json syntax, I think) where all the hotkeys are listed. Here is, for example, the custom ones:
Code: Select all
{
"j": "window.goDoCommand('cmd_nextMsg')",
"k": "window.goDoCommand('cmd_previousMsg')",
"o": "window.goDoCommand('cmd_openMessage')",
"f": "window.goDoCommand('cmd_forward')",
"#": "window.goDoCommand('cmd_delete')",
"r": "window.goDoCommand('cmd_reply')",
"a": "window.goDoCommand('cmd_replyall')",
"x": "window.goDoCommand('cmd_archive')",
"u": "if (((window.document.activeElement.id == 'messagepane') || (window.document.activeElement == 'threadTree' )) && (window.document.getElementById('tabmail').tabContainer.selectedIndex!=0)){ window.CloseTabOrWindow()}; window.goDoCommand('cmd_getMsgsForAuthAccounts'); window.goDoCommand('cmd_expandAllThreads')"
}
Code: Select all
var kNoRemoteContentPolicy = 0;
var kBlockRemoteContent = 1;
var kAllowRemoteContent = 2;
var msgHdr = gMessageDisplay.displayedMessage;
if (msgHdr) {
var remoteContentPolicy = msgHdr.getUint32Property("remoteContentPolicy");
if (remoteContentPolicy == kBlockRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kAllowRemoteContent);
} else if (remoteContentPolicy == kAllowRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kNoRemoteContentPolicy);
}
window.content.focus();
}
- tanstaafl
- Moderator
- Posts: 49647
- Joined: July 30th, 2003, 5:06 pm
Re: "Show remote content" hotkey?
I was pleasantly surprised to read: "Thunderbird 78 compatibility: Converts extension from legacy bootstrapped extension to MailExtension with a WebExtension Experiment." on the tbkeys web site. That means it has a future.
It also states: "To customize keybindings, modify the "Key bindings" entry in the add-on's preferences pane which can be accessed from the add-on's entry in the Add-ons Manager ("Add-ons" in the Thunderbird menu). The "Key bindings" entry should be a JSON object mapping keybindings (with Mousetrap syntax) to javascript code to execute (see here for cmd name references). The default keybindings can be restored by deleting all the text the "Key bindings" field and clicking "Submit". The preferences page will not allow invalid JSON to be submitted, but it does not sanity check the keybindings otherwise."
I suspect you need to learn the Mousetrap (A simple library for handling keyboard shortcuts in Javascript) syntax. See https://craig.is/killing/mice
It also states: "To customize keybindings, modify the "Key bindings" entry in the add-on's preferences pane which can be accessed from the add-on's entry in the Add-ons Manager ("Add-ons" in the Thunderbird menu). The "Key bindings" entry should be a JSON object mapping keybindings (with Mousetrap syntax) to javascript code to execute (see here for cmd name references). The default keybindings can be restored by deleting all the text the "Key bindings" field and clicking "Submit". The preferences page will not allow invalid JSON to be submitted, but it does not sanity check the keybindings otherwise."
I suspect you need to learn the Mousetrap (A simple library for handling keyboard shortcuts in Javascript) syntax. See https://craig.is/killing/mice
-
- Posts: 6432
- Joined: February 3rd, 2009, 6:29 pm
Re: "Show remote content" hotkey?
These code snippets work correctly in the error console in Thunderbird 68.
Multiple line code snippet with the double quote characters:
Single line code snippet with the single quote characters:
I guess you could paste the single line code snippet into the background.js file like so. (not tested)
tbkeys
http://github.com/willsALMANJ/tbkeys
http://github.com/willsALMANJ/tbkeys/bl ... kground.js
Multiple line code snippet with the double quote characters:
Code: Select all
(function () {
var kNoRemoteContentPolicy = 0;
var kBlockRemoteContent = 1;
var kAllowRemoteContent = 2;
var msgHdr = gMessageDisplay.displayedMessage;
if (msgHdr) {
var remoteContentPolicy = msgHdr.getUint32Property("remoteContentPolicy");
if (remoteContentPolicy == kBlockRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kAllowRemoteContent);
} else if (remoteContentPolicy == kAllowRemoteContent) {
setMsgHdrPropertyAndReload("remoteContentPolicy", kNoRemoteContentPolicy);
}
window.content.focus();
}
})();
Code: Select all
(function () { var kNoRemoteContentPolicy = 0; var kBlockRemoteContent = 1; var kAllowRemoteContent = 2; var msgHdr = gMessageDisplay.displayedMessage; if (msgHdr) { var remoteContentPolicy = msgHdr.getUint32Property('remoteContentPolicy'); if (remoteContentPolicy == kBlockRemoteContent) { setMsgHdrPropertyAndReload('remoteContentPolicy', kAllowRemoteContent); } else if (remoteContentPolicy == kAllowRemoteContent) { setMsgHdrPropertyAndReload('remoteContentPolicy', kNoRemoteContentPolicy); } window.content.focus(); } })();
Code: Select all
- "c": "window.MsgNewMessage()",
+ "c": "(function () { var kNoRemoteContentPolicy = 0; ... window.content.focus(); } })();",
http://github.com/willsALMANJ/tbkeys
http://github.com/willsALMANJ/tbkeys/bl ... kground.js
Last edited by morat on July 19th, 2020, 8:03 pm, edited 2 times in total.