mirror of
https://github.com/munki/munki.git
synced 2026-05-12 23:38:50 -05:00
Implement JavaScript integration for 'openExternalLink'
This commit is contained in:
+1
@@ -366,6 +366,7 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe
|
||||
|
||||
func addJSmessageHandlers() {
|
||||
// define messages JavaScript can send us
|
||||
wkContentController.add(self, name: "openExternalLink")
|
||||
wkContentController.add(self, name: "installButtonClicked")
|
||||
wkContentController.add(self, name: "myItemsButtonClicked")
|
||||
wkContentController.add(self, name: "actionButtonClicked")
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ function stageClicked() {
|
||||
slide = slides()[currentSlide];
|
||||
target = slide.getAttribute('target');
|
||||
if (target == '_blank') {
|
||||
window.AppController.openExternalLink_(slide.getAttribute('href'));
|
||||
window.webkit.messageHandlers.openExternalLink.postMessage(slide.getAttribute('href'));
|
||||
} else {
|
||||
window.location.href = slide.getAttribute('href');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user