Add iOS fallback for RichDocumentsMobileInterface

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-09-12 08:25:55 +02:00
Родитель e74c2a8487
Коммит 2ffbf8ddb5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 60C25B8C072916CF
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -483,6 +483,18 @@ var documentsMain = {
return;
}
// iOS webkit fallback
if (window.webkit.messageHandlers.RichDocumentsMobileInterface) {
if (msgId === 'UI_Close') {
window.webkit.messageHandlers.RichDocumentsMobileInterface.postMessage('close');
} else if (msgId === 'UI_InsertGraphic') {
window.webkit.messageHandlers.RichDocumentsMobileInterface.postMessage('insertGraphic');
} else if (msgId === 'UI_Share') {
window.webkit.messageHandlers.RichDocumentsMobileInterface.postMessage('share');
}
return;
}
if (msgId === 'UI_Close' || msgId === 'close' /* deprecated */) {
// If a postmesage API is deprecated, we must ignore it and wait for the standard postmessage
// (or it might already have been fired)