mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 22:36:08 +00:00
Made registerProtocolHandler('mailto') optional by activating at Settings -> General
This commit is contained in:
@@ -30,6 +30,8 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.mailto = ko.observable(!!navigator.registerProtocolHandler);
|
||||
|
||||
this.language = LanguageStore.language;
|
||||
this.languages = LanguageStore.languages;
|
||||
this.hourCycle = LanguageStore.hourCycle;
|
||||
@@ -181,4 +183,14 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
||||
selectLanguage() {
|
||||
showScreenPopup(LanguagesPopupView, [this.language, this.languages(), LanguageStore.userLanguage()]);
|
||||
}
|
||||
|
||||
registerMailto() {
|
||||
navigator.registerProtocolHandler(
|
||||
'mailto',
|
||||
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
||||
(SettingsGet('title') || 'SnappyMail')
|
||||
);
|
||||
alert(i18n('GLOBAL/DONE'));
|
||||
this.mailto(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user