update safari sub-repo to latest extension manifest

This commit is contained in:
SethBurkart123
2023-12-03 11:39:50 +11:00
parent c940cdf106
commit 9abc4dab53
10 changed files with 350 additions and 373 deletions
+16 -16
View File
@@ -1,24 +1,24 @@
function show(platform, enabled, useSettingsInsteadOfPreferences) {
document.body.classList.add(`platform-${platform}`);
document.body.classList.add(`platform-${platform}`);
if (useSettingsInsteadOfPreferences) {
document.getElementsByClassName('platform-mac state-on')[0].innerText = 'BetterSEQTA+s extension is currently on. You can turn it off in the Extensions section of Safari Settings.';
document.getElementsByClassName('platform-mac state-off')[0].innerText = 'BetterSEQTA+s extension is currently off. You can turn it on in the Extensions section of Safari Settings.';
document.getElementsByClassName('platform-mac state-unknown')[0].innerText = 'You can turn on BetterSEQTA+s extension in the Extensions section of Safari Settings.';
document.getElementsByClassName('platform-mac open-preferences')[0].innerText = 'Quit and Open Safari Settings…';
}
if (useSettingsInsteadOfPreferences) {
document.getElementsByClassName('platform-mac state-on')[0].innerText = "BetterSEQTA+s extension is currently on. You can turn it off in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac state-off')[0].innerText = "BetterSEQTA+s extension is currently off. You can turn it on in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac state-unknown')[0].innerText = "You can turn on BetterSEQTA+s extension in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac open-preferences')[0].innerText = "Quit and Open Safari Settings…";
}
if (typeof enabled === 'boolean') {
document.body.classList.toggle('state-on', enabled);
document.body.classList.toggle('state-off', !enabled);
} else {
document.body.classList.remove('state-on');
document.body.classList.remove('state-off');
}
if (typeof enabled === "boolean") {
document.body.classList.toggle(`state-on`, enabled);
document.body.classList.toggle(`state-off`, !enabled);
} else {
document.body.classList.remove(`state-on`);
document.body.classList.remove(`state-off`);
}
}
function openPreferences() {
webkit.messageHandlers.controller.postMessage('open-preferences');
webkit.messageHandlers.controller.postMessage("open-preferences");
}
document.querySelector('button.open-preferences').addEventListener('click', openPreferences);
document.querySelector("button.open-preferences").addEventListener("click", openPreferences);
+3 -3
View File
@@ -2,7 +2,7 @@
// ViewController.swift
// Shared (App)
//
// Created by Seth Burkart on 10/9/2023.
// Created by Seth Burkart on 3/12/2023.
//
import WebKit
@@ -62,7 +62,7 @@ class ViewController: PlatformViewController, WKNavigationDelegate, WKScriptMess
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
#if os(macOS)
if (message.body as! String != "open-preferences") {
return;
return
}
SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
@@ -72,7 +72,7 @@ class ViewController: PlatformViewController, WKNavigationDelegate, WKScriptMess
}
DispatchQueue.main.async {
NSApplication.shared.terminate(nil)
NSApp.terminate(self)
}
}
#endif