Giter Site home page Giter Site logo

Comments (15)

heilerich avatar heilerich commented on June 23, 2024 1

According to this discussion this seems pretty easy to implement, at least on MacOS.

To open a prefilled composer on the protonmail web client you can do this

var injector = window.angular.element(document).injector()

var root = injector.get("$rootScope")
var messageModel = injector.get("messageModel")

let composeWithMessage = (message) => root.$emit("composer.new", { "type": "new", "data": {"message": message} })

let compose = (toAddress, subject, body) => {
	let message = messageModel()
	message.Subject = subject

	message.AutoSaveContacts = 0;
	message.ToList = [{ Address: toAddress, Name: toAddress }]
	message.setDecryptedBody(body)
	composeWithMessage(message)
}

compose("[email protected]", "Testsubjects wanted", "We want your dead body")

Would you be willing to give it a try? Otherwise I could also try to implement this and drop you a PR if you want to, which would probably take some time though.

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024 1

@heilerich if you will be considering adding a holistic implementation, mailto URL scheme handling would be the starting point. There will be a need to actually verify that it works on Win 7/8/10, Linux (at least Ubuntu recent + Arch) and macOS. This presumably might be a time-consuming task. By the way, Tutanota's desktop app seems to have some hacks for Windows. The remaining stuff I think I could help with or handle completely, including testing.

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024 1

It's unlikely to come in the near future.

from electronmail.

skewty avatar skewty commented on June 23, 2024

Same issue. I am not able to set as default app in Linux / Ubuntu / Gnome-shell

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024

In general, the task consists of two parts:

  • First is the integration with the system complete and robust implementation of which might be tricky especially on Windows (there most likely will be a need to directly mess with a Windows Registry). So the implementation might look sophisticated and will require testing on Windows 7-8-10, Linux and macOS. This is more like a one-off task though.
  • The second part is opening a prefilled composer, ie the integration with prepackaged official web clients (like the above-shown AngularJS code snippet). This part increases the maintenance burden.

Would you be willing to give it a try?

I'm not planning to jump into the task yet.

Otherwise I could also try to implement this and drop you a PR if you want to, which would probably take some time though.

As I pointed out adding the feature will increase the maintenance burden. Any web client update could potentially break the functionality so if at least the integration with the web clients code layer will be covered by automated tests then I will accept the PR. Alternatively, if you only need this working on macOS, don't want to deal with tests, etc, you could fork the project, add the change, hook the project up with the CI system and get your own installation package as an outcome.

There also will be an in-between task - showing a list with added to the program accounts, and only having the specific account selected the opening a prefilled composer action will kick in.

from electronmail.

heilerich avatar heilerich commented on June 23, 2024

Thanks for the quick reply! I will look into how much effort this will take and reconsider if I am willing to do this for everyone or just me.

Regarding your first point, the registration of the URL scheme, I don't think we need to implement this ourselves (and mess with the Windows Registry and such) as it seems the Electron framework has already taken care of this. There's an API for registering, unregistering and checking default url scheme handlers with the OS.

if at least the integration with the web clients code layer will be covered by automated tests

Could you point me to the sources of the specific tests for the existing web clients for a reference? I searched real quick and couldn't find anything.

Also, would you insist on tutanota support?

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024

Electron framework has already taken care of this

I've looked into this topic before. Electron handles the need but the implementation is not complete this is why some hacks expected to be needed.

Could you point me to the sources of the specific tests for the existing web clients for a reference? I searched real quick and couldn't find anything.

There are no tests implemented specifically for preload scripts or web clients. Could be Spectron-based, the example is here. Besides I think, depending on the implementation a custom fixture-like page with prepared web client + app custom/integration logic could be loaded and executed using karma runner.

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024

Also, would you insist on tutanota support?

Nope as tutanota support is already deprecated and going to be removed at some point.

from electronmail.

skewty avatar skewty commented on June 23, 2024

With the recent rebase onto Electron 9.0.0-beta.5 is has url scheme handling been improved?

from electronmail.

vladimiry avatar vladimiry commented on June 23, 2024

Nothing new was done in the app code in regard to handling mailto scheme.

from electronmail.

bbhtt avatar bbhtt commented on June 23, 2024

Same issue. I am not able to set as default app in Linux / Ubuntu / Gnome-shell

It can already handle mailto links on a webpage atleast on Linux this is easier (Arch/Xfce), just not the direct compose box...

from electronmail.

ystxn avatar ystxn commented on June 23, 2024

is this still pending changes to electron or considered a will not do?

from electronmail.

brcha avatar brcha commented on June 23, 2024

I would like to see this functioning as well.

from electronmail.

t3dium avatar t3dium commented on June 23, 2024

yeah i agree this'd be a pretty convenient feature to have

from electronmail.

bkmo avatar bkmo commented on June 23, 2024

It would be great. The tutanota appimage handles it perfectly. It also works with attachments right from the dolphin file manager.

from electronmail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.