Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Is there a command for showing remote content? #136

Open
techmuch opened this issue Apr 9, 2023 · 13 comments
Open

[QUESTION] Is there a command for showing remote content? #136

techmuch opened this issue Apr 9, 2023 · 13 comments

Comments

@techmuch
Copy link

techmuch commented Apr 9, 2023

For example, I would like a hotkey to show images within an html email

@trulycool
Copy link

I would also love to know if there is a command for this.

When first installing tbkeys-lite a year or two back, could not track it down. Ended up having to hack together an AutoHotkey shortcut that sends the literal keypresses, so when I use Alt + C in mail reader window it sends the key sequence exactly as if you were pressing Alt + O (opens options menu from button) then S (selects and runs the Show Remote Content entry).

It works, but feels hacky compared to knowing the TB internal command. And of course it's Windows only, since afaik there is no AHK for Mac or Linux...

Here is my AHK code in case it's helpful to others until someone sorts out the internal TB command:

;### ThunderbirdDone fixes
; Show Remote Contect shortcut to Thunderbird
#IfWinActive ahk_exe thunderbird.exe
	; alt + c
	!c:: ; Thunderbird Show Remote Content
	Send {Alt down}o{Alt up}s
return
;### END: Thunderbird fixes

@trulycool
Copy link

trulycool commented Apr 9, 2023

It appears that once upon a time, TB had an internal command to do this:

LoadMsgWithRemoteContent

http://kb.mozillazine.org/Keyconfig_extension:_Thunderbird

...however sadly, this does not appear to work w/ current TB versions :(

@morat523035
Copy link

The following command works with the error console.

window.LoadMsgWithRemoteContent();

Are you using tbkey or tbkeys-lite?

You cannot run arbitrary javascript with tbkeys-lite.

There is a tbkeys.xpi link on the GitHub releases page.

@trulycool
Copy link

Well would you look at that, it works great in console!

I am currently running tbkeys-lite, I ended up w/ that since it was what was available in Thunderbird Add-ons.

I guess they not allow you to list the regular tbkeys there because of the ability to run arbitrary javascript w/ eval? Frustrating...

I wrote a somewhat extended plea on the TB keybinding API request thread you mention in the tbkeys repo.

Thank you for all your hard work on this extension, and for taking the time to respond to this thread. Much appreciated 🙏

@trulycool
Copy link

Thank you @morat523035 !

While I hack about Firefox & FF Extensions, rarely mess w/ Thunderbird (tho it is my main mail app). Hadn't even tried the Dev Tools console...

I just assumed that TB had dropped the command altogether. But after seeing it run via console...was inspired to push a bit more...

And just after writing a [probably way too long] impassioned plea to the Thunderbird dev thread where @wshanks points in the full tbkeys repo, wherein he succinctly explains how his extension and the wonderful Nostalgy were both hobbled by the removal of a proper keyboard API...

I went back to the tbkeys-lite options, and noticed that in addition to the cmd: prefix, which calls internal TB commands, and which did not work w/ LoadMsgWithRemoteContent, there is a func: prefix too...

And voila! We can haz keyboard shortcut to 'Show remote content in message' w/ tbkeys-lite!

"ctrl+shift+c": "func:LoadMsgWithRemoteContent"

Thanks to all for the code and info; open source rules!

🙏🙌🕸

@techmuch
Copy link
Author

Works perfectly!!! 🙏 🙏 🙏

@techmuch
Copy link
Author

Thank you for your hard work and dedication to open-source software it is greatly appreciated. Thank you for making email management even easier!

@Crandel
Copy link

Crandel commented Jul 26, 2023

Since thunderbird 115 update func:LoadMsgWithRemoteContent is not working anymore

@morat523035
Copy link

morat523035 commented Jul 26, 2023

The LoadMsgWithRemoteContent function is now defined in the aboutMessage.xhtml window, not the messenger.xhtml window.

Try the following command with tbkeys.

window.gTabmail.currentAboutMessage.LoadMsgWithRemoteContent();

You cannot run arbitrary javascript with tbkeys-lite.

There is a tbkeys.xpi link on the GitHub releases page.

About new mail front end
http://developer.thunderbird.net/thunderbird-development/codebase-overview/mail-front-end
http://developer.thunderbird.net/add-ons/updating/tb115/adapt-to-changes-in-thunderbird-103-115

@Crandel
Copy link

Crandel commented Jul 26, 2023

I'm using tbkeys, but have no idea how to run this code.
This is my settings and nothing happens when I press Ctrl+h.

"ctrl+h": "(function () {window.gTabmail.currentAboutMessage.LoadMsgWithRemoteContent(); window.content.focus();});"

@morat523035
Copy link

morat523035 commented Jul 26, 2023

Try this:

"ctrl+h": "window.gTabmail.currentAboutMessage.LoadMsgWithRemoteContent();"

Remember to select a message with blocked remote content before running that command.

Troubleshooting
http://forums.mozillazine.org/viewtopic.php?p=14872763#p14872763

@Crandel
Copy link

Crandel commented Jul 26, 2023

Thank you. Now everything is working correctly

@wshanks
Copy link
Owner

wshanks commented Jul 26, 2023

"ctrl+h": "(function () {window.gTabmail.currentAboutMessage.LoadMsgWithRemoteContent(); window.content.focus();});"

Here I think the issue might have been a missing ( -- you have an unmatched ) at the end. I think the end should be ().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants