MozillaZine

"Show remote content" hotkey?

User Help for Mozilla Thunderbird
MicheleBS
 
Posts: 74
Joined: May 11th, 2012, 11:14 am

Post Posted September 5th, 2014, 2:36 am

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:

Image

Thanks!

DanRaisch
Moderator

User avatar
 
Posts: 121442
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted September 5th, 2014, 4:24 am

Moving to Thunderbird Support.

morat
 
Posts: 3198
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 5th, 2014, 5:45 am

Try this:

* 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();
}

MicheleBS
 
Posts: 74
Joined: May 11th, 2012, 11:14 am

Post Posted September 5th, 2014, 2:44 pm

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.

morat
 
Posts: 3198
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 5th, 2014, 7:01 pm

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".

Image

What version of Thunderbird are you using? I am assuming you are using the release build.

MicheleBS
 
Posts: 74
Joined: May 11th, 2012, 11:14 am

Post Posted September 7th, 2014, 10:42 am

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:

  • 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?;

    Image

morat
 
Posts: 3198
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 7th, 2014, 9:56 pm

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

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?

Image

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.

MicheleBS
 
Posts: 74
Joined: May 11th, 2012, 11:14 am

Post Posted September 9th, 2014, 4:54 pm

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.

morat
 
Posts: 3198
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 9th, 2014, 8:18 pm

You're welcome.

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

MicheleBS
 
Posts: 74
Joined: May 11th, 2012, 11:14 am

Post Posted September 13th, 2014, 4:52 pm

...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.

:wink:


***
p.s. "C" is the shortcut I chose

screennam
 
Posts: 1
Joined: August 12th, 2010, 12:17 pm

Post Posted March 6th, 2015, 10:47 am

morat wrote:Instructions:

1. install extension and restart

http://mozilla.dorando.at/keyconfig.xpi
...


Sorry for my newbie question but how do you install this to Thunderbird?

LIMPET235
Moderator

User avatar
 
Posts: 38674
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Post Posted March 6th, 2015, 10:54 am

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.)
Ancient Amateur Astronomer
Win-7-HP/Intel® DualCore-2.0GHz/500G HDD/4 Gig Ram/550Watt PSU/350WattUPS/Firefox-20.0-57.0-61.0-62.0/T-bird-2.0.0.24/SnagIt-v10.0.1/MWP-7.11.0.
(Always choose the "Custom" Install.)

Return to Thunderbird Support


Who is online

Users browsing this forum: Bing [Bot] and 5 guests