create new tab via safari app message

This commit is contained in:
Kyle Spearrin 2019-08-20 15:10:17 -04:00
parent 0f3cef7762
commit fc7bbed965
2 changed files with 4 additions and 1 deletions

View File

@ -184,7 +184,7 @@ export class BrowserApi {
chrome.tabs.create({ url: url });
return null;
} else if (BrowserApi.isSafariApi) {
// TODO
SafariApp.sendMessageToApp('createNewTab', url, true);
return;
} else {
return;

View File

@ -151,6 +151,9 @@ class SafariExtensionViewController: SFSafariExtensionViewController, WKScriptMe
} else if command == "isPopoverOpen" {
m!.responseData = popoverOpenCount > 0 ? "true" : "false";
replyMessage(message: m!)
} else if command == "createNewTab" {
// TODO
replyMessage(message: m!)
} else if command == "reloadExtension" {
webView?.reload()
replyMessage(message: m!)