From b0d206b66342dbcef8bc6633d4e06e35749e1581 Mon Sep 17 00:00:00 2001 From: Nano Anderson Date: Thu, 15 Feb 2024 22:12:51 -1000 Subject: [PATCH 1/5] Allow selecting specific engine to redirect in popup --- .../Base.lproj/Main.storyboard | 8 +- .../Shared (App)/Base.lproj/Main.html | 3 + .../Resources/background.js | 68 +++++++-- .../Shared (Extension)/Resources/popup.css | 6 +- .../Shared (Extension)/Resources/popup.html | 22 ++- .../Shared (Extension)/Resources/popup.js | 141 ++++++++++++------ 6 files changed, 175 insertions(+), 73 deletions(-) diff --git a/safari/Universal/Kagi Search (macOS)/Base.lproj/Main.storyboard b/safari/Universal/Kagi Search (macOS)/Base.lproj/Main.storyboard index ee58e6b..3357704 100644 --- a/safari/Universal/Kagi Search (macOS)/Base.lproj/Main.storyboard +++ b/safari/Universal/Kagi Search (macOS)/Base.lproj/Main.storyboard @@ -306,9 +306,9 @@ - + - + @@ -326,11 +326,11 @@ - + - + diff --git a/safari/Universal/Shared (App)/Base.lproj/Main.html b/safari/Universal/Shared (App)/Base.lproj/Main.html index 656eae4..5ca48a2 100644 --- a/safari/Universal/Shared (App)/Base.lproj/Main.html +++ b/safari/Universal/Shared (App)/Base.lproj/Main.html @@ -32,6 +32,9 @@

Instructions

    +
  1. +

    Optional: Select the search engine you want to redirect to Kagi in the extension popup.

    +
  2. To enable Kagi in Private Browsing, check the "Allow in Private Browsing" checkboxenable the "Private Browsing" toggle switch. Then copy your Kagi private session link from your Kagi account settings into the extension popup. diff --git a/safari/Universal/Shared (Extension)/Resources/background.js b/safari/Universal/Shared (Extension)/Resources/background.js index 7e6a3b1..9b28aab 100644 --- a/safari/Universal/Shared (Extension)/Resources/background.js +++ b/safari/Universal/Shared (Extension)/Resources/background.js @@ -278,6 +278,27 @@ const yahooUrls = { "search.yahoo.com": "p" }; const builtInEngines = Object.assign({}, googleUrls, yandexUrls, ddgUrls, bingUrls, baiduUrls, sogouUrls, ecosiaUrls, yahooUrls); +const domainMap = { + "Google": ["google.com.au", "google.md", "google.ru", "google.me", "google.com.qa", "google.com.gt", "google.se", "google.tm", "google.vg", "google.it", "google.cat", "google.com.ru", "google.com.gr", "google.ee", "google.cd", "google.sk", "google.com.ly", "google.hn", "google.co.jp", "google.ad", "google.com.sg", "google.ie", "google.co.vi", "google.kg", "google.com.kh", "google.co.ck", "google.is", "google.tt", "google.vu", "google.bg", "google.ch", "google.com.sa", "google.tn", "google.pl", "google.ro", "google.gm", "google.tl", "google.mg", "google.dk", "google.com.bo", "google.je", "google.com.kw", "google.dz", "google.ga", "google.com.gh", "google.lt", "google.com.ag", "google.ps", "google.com.vc", "google.com.pr", "google.co.cr", "google.pn", "google.com.tr", "google.sn", "google.tg", "google.gg", "google.gr", "google.com.mt", "google.nu", "google.cm", "google.lk", "google.co.mz", "google.cv", "google.sm", "google.no", "google.al", "google.bi", "google.com.af", "google.sr", "google.jo", "google.sh", "google.co.uk", "google.co.bw", "google.dm", "google.at", "google.co.ug", "google.dj", "google.si", "google.com.pg", "google.com.tj", "google.co.za", "google.nl", "google.sc", "google.ae", "google.mv", "google.ne", "google.gy", "google.com.sl", "google.co.in", "google.com.bn", "google.ht", "google.com.ua", "google.com.my", "google.co.kr", "google.com", "google.by", "google.com.cu", "google.com.lb", "google.co.nz", "google.mu", "google.com.om", "google.as", "google.com.pe", "google.mk", "google.td", "google.es", "google.az", "google.com.hk", "google.com.do", "google.bt", "google.am", "google.fm", "google.com.mx", "google.fi", "google.com.bz", "google.st", "google.com.vn", "google.rs", "google.bs", "google.cn", "google.com.pa", "google.com.sb", "google.lv", "google.co.uz", "google.co.hu", "google.co.ve", "google.co.zw", "google.com.ai", "google.com.co", "google.ci", "google.com.uy", "google.cl", "google.mw", "google.cz", "google.co.il", "google.co.th", "google.be", "google.hr", "google.fr", "google.im", "google.com.ec", "google.cg", "google.iq", "google.com.np", "google.gl", "google.co.ke", "google.co.id", "google.ml", "google.ms", "google.com.ni", "google.mn", "google.ki", "google.lu", "google.hu", "google.rw", "google.co.ma", "google.com.tw", "google.co.ls", "google.com.et", "google.li", "google.com.br", "google.bj", "google.com.py", "google.co.tz", "google.ba", "google.co.ao", "google.bf", "google.com.ph", "google.com.sv", "google.com.bd", "google.com.mm", "google.la", "google.ws", "google.com.fj", "google.co.zm", "google.cf", "google.nr", "google.to", "google.com.jm", "google.com.ar", "google.com.gi", "google.ca", "google.kz", "google.com.cy", "google.de", "google.com.na", "google.com.pk", "google.pt", "google.ge", "google.so", "google.com.bh", "google.com.eg", "google.com.ng"], + "DuckDuckGo": ["duckduckgo.com", "duckduckgo.pl", "duckduckgo.jp", "duckduckgo.co", "duckduckco.de", "duckduckgo.ca", "duckduckgo.co.uk", "duckduckgo.com.mx", "duckduckgo.com.tw", "duckduckgo.dk", "duckduckgo.in", "duckduckgo.ke", "duckduckgo.mx", "duckduckgo.nl", "duckduckgo.org", "duckduckgo.sg", "duckduckgo.uk", "duckgo.com", "ddg.co", "ddg.gg", "duck.co", "duck.com"], + "Yahoo": ["search.yahoo.com"], + "Ecosia": ["ecosia.org"], + "Bing": ["bing.com"], + "Sogou": ["m.so.com", "so.com", "sogou.com", "m.sogou.com"], + "Baidu": ["baidu.com", "m.baidu.com"], + "Yandex": ["yandex.ru", "yandex.org", "yandex.net", "yandex.net.ru", "yandex.com.ru", "yandex.ua", "yandex.com.ua", "yandex.by", "yandex.eu", "yandex.ee", "yandex.lt", "yandex.lv", "yandex.md", "yandex.uz", "yandex.mx", "yandex.do", "yandex.tm", "yandex.de", "yandex.ie", "yandex.in", "yandex.qa", "yandex.so", "yandex.nu", "yandex.tj", "yandex.dk", "yandex.es", "yandex.pt", "yandex.pl", "yandex.lu", "yandex.it", "yandex.az", "yandex.ro", "yandex.rs", "yandex.sk", "yandex.no", "ya.ru", "yandex.com", "yandex.asia", "yandex.mobi"] +}; +function domainKeyForHost(knownHost) { + let domainKeys = Object.keys(domainMap); + for (let i=0; i -1) { + return domainKey; + } + } + return ""; +} +const supportedEngineNames = Object.keys(domainMap); const www = "www."; const yahoo = "search.yahoo.com"; const extensionId = "com.kagi.Kagi-Search-for-Safari.Extension (TFVG979488)"; @@ -288,10 +309,11 @@ var ua = {}, os = !0, rs = !0, currentEngine = "All", + defaultEngineToRedirect = "Google", defaultKagiSearchTemplate = "https://kagi.com/search?q=%s", kagiSearchTemplate = defaultKagiSearchTemplate, kagiPrivateSearchTemplate = "", - flagCheckedLocalStorageForPrivateSessionLink = false, + flagFetchedPreferences = false, customURLMode = 0, customURLList = [], regularTabIds = [], @@ -317,7 +339,8 @@ function captureQuery(a) { b.endsWith(yahoo) && (b = yahoo); const path = a.pathname; var shouldBlockGoogleNonSearch = (b in googleUrls && !(path.startsWith("/search"))); - if (b in builtInEngines && !(shouldBlockGoogleNonSearch) && (a = (new URLSearchParams(a.search)).get(builtInEngines[b]))) return a; + var shouldBlockRedirectBasedOnUserPreference = ([currentEngine, "All"].indexOf(domainKeyForHost(b)) < 0); + if (b in builtInEngines && !(shouldBlockGoogleNonSearch || shouldBlockRedirectBasedOnUserPreference) && (a = (new URLSearchParams(a.search)).get(builtInEngines[b]))) return a; } function rewriteQueryURL(a, b) { @@ -341,10 +364,10 @@ function rewriteQueryURL(a, b) { } var tk = 0; function checkForSearch(a) { - if (!flagCheckedLocalStorageForPrivateSessionLink) { - console.log("[checkForSearch] Search query started before local private session link was fetched"); - checkLocalStorageForPrivateSessionLink(function(){ - console.log("[checkForSearch] Fetched local private session link as part of first search query during current browsing session"); + if (!flagFetchedPreferences) { + console.log("[checkForSearch] Search query started before preferences were fetched"); + getPreferencesFromStorage(function(){ + console.log("[checkForSearch] Fetched preferences as part of first search query during current browsing session"); _checkForSearch(a); }); } else { @@ -414,13 +437,23 @@ function updatePrivateSessionLink(link) { } } -function checkLocalStorageForPrivateSessionLink(callback) { - browser.storage.local.get("kagiPrivateSessionLink", function(value) { +function getPreferencesFromStorage(callback) { + browser.storage.local.get(["kagiPrivateSessionLink","kagiEngineToRedirect"], function(value) { + // Private session link var link = value.kagiPrivateSessionLink; if (typeof (link) !== "undefined") { updatePrivateSessionLink(link); } - flagCheckedLocalStorageForPrivateSessionLink = true; + // Engine to redirect + var engine = value.kagiEngineToRedirect; + if (typeof (engine) !== "undefined") { + if (engine == "All" || supportedEngineNames.indexOf(engine) < 0) { + currentEngine = defaultEngineToRedirect; // default to redirecting Google + } else { + currentEngine = engine; + } + } + flagFetchedPreferences = true; callback(); }); } @@ -454,18 +487,21 @@ browser.runtime.onInstalled.addListener(function(details) { }); -// Check for a private session link at startup so that the first search +// Check for a private session link and default engine at startup so that the first search // in a private window or tab doesn't fail -checkLocalStorageForPrivateSessionLink(function(){ - console.log("Finished startup check for local private session link"); +getPreferencesFromStorage(function(){ + console.log("Finished fetching preferences on startup"); }); function messageReceived(data, sender) { let updatedKagiPrivateSessionLink = data["updatedKagiPrivateSessionLink"]; - if (stringIsValid(updatedKagiPrivateSessionLink)) { - return updatePrivateSessionLink(updatedKagiPrivateSessionLink) - .then(() => Promise.resolve(true)) - .catch((error) => Promise.reject(error)); + let updatedKagiEngineToRedirect = data["updatedKagiEngineToRedirect"]; + if (stringIsValid(updatedKagiPrivateSessionLink) || stringIsValid(updatedKagiEngineToRedirect)) { + // FIXME: Decide whether to send the session link and engine choice through storage or through the message itself. Right now we're doing both. + getPreferencesFromStorage(function(){ + console.log("Finished fetching preferences after receiving an update message from popup.js"); + }); + return Promise.resolve(true); } else { return false; } diff --git a/safari/Universal/Shared (Extension)/Resources/popup.css b/safari/Universal/Shared (Extension)/Resources/popup.css index 4759cbd..61619d6 100644 --- a/safari/Universal/Shared (Extension)/Resources/popup.css +++ b/safari/Universal/Shared (Extension)/Resources/popup.css @@ -77,6 +77,10 @@ fieldset { input, select, p, label, button { width: 100%; } +fieldset input, fieldset select { + font-size: 0.9em; + font-weight: 300; +} fieldset select { margin-bottom: 8px; } @@ -85,8 +89,6 @@ fieldset input { border-style: solid; border-width: 1px; border-color: #eee; - font-size: 0.9em; - font-weight: 300; padding: 3px; } diff --git a/safari/Universal/Shared (Extension)/Resources/popup.html b/safari/Universal/Shared (Extension)/Resources/popup.html index a4b308a..5b40ae6 100644 --- a/safari/Universal/Shared (Extension)/Resources/popup.html +++ b/safari/Universal/Shared (Extension)/Resources/popup.html @@ -11,7 +11,7 @@
    • -

      Kagi searches enabled on:

      +

      Kagi extension enabled on:

      @@ -22,13 +22,29 @@

      Kagi searches enabled on:

    • +
    • +

      Engine to redirect

      +

      Select the search engine you want to redirect to Kagi.

      +
      + +
      +
    • Private browsing

      To search in Private Browsing, paste the Kagi private session link in the textbox below after copying it from your Kagi account settings.

      - -
      + +
    diff --git a/safari/Universal/Shared (Extension)/Resources/popup.js b/safari/Universal/Shared (Extension)/Resources/popup.js index e297bdc..0c59e40 100644 --- a/safari/Universal/Shared (Extension)/Resources/popup.js +++ b/safari/Universal/Shared (Extension)/Resources/popup.js @@ -55,20 +55,6 @@ function paramsForKnownHosts(knownHosts) { } return params.filter((value, index, array) => array.indexOf(value) === index); } -// const extensionId = "com.kagi.Kagi-Search-for-Safari.Extension (TFVG979488)"; -// const userAgent = window.navigator.userAgent, -// platform = window.navigator?.userAgentData?.platform || window.navigator.platform, -// macosPlatforms = ['macOS', 'Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], -// iosPlatforms = ['iPhone', 'iPad', 'iPod']; -// document.getElementById("open-app").onclick = function() { -// if (macosPlatforms.indexOf(platform) !== -1) { -// browser.runtime.sendNativeMessage(extensionId, {"type": "openApp"}, function(response) { -// window.close(); -// }); -// } else if (iosPlatforms.indexOf(platform) !== -1) { -// window.open("kagisearch://") -// } -// } // ----------------------- // MARK: - Private session link handling @@ -91,7 +77,42 @@ function privateSessionLinkTextfieldChanged(evt) { document.querySelector("#private-session-link").addEventListener('change', privateSessionLinkTextfieldChanged); document.querySelector("#private-session-link").addEventListener('paste', privateSessionLinkTextfieldChanged); - + + +// ----------------------- +// MARK: - Selecting default engine to redirect +// ----------------------- +var engineToRedirect = "All"; +const defaultEngineToRedirect = "Google"; +const engineSelect = document.getElementById('engine-to-redirect'); + +// Updates the UI +function selectCurrentEngine(currentEngine) { + selectCurrentEngineIndex(Array.from(engineSelect.options).indexOf(engineSelect.namedItem(currentEngine))); +} +function selectCurrentEngineIndex(engineIndex) { + engineSelect.selectedIndex = engineIndex; +} + +// Runs when the selection changes +function engineToRedirectChanged() { + const index = engineSelect.selectedIndex; + updateEngineToRedirect(engineSelect.options[index].value); +} + +// Stores the new engine in storage +function updateEngineToRedirect(newEngine) { + engineToRedirect = newEngine; + selectCurrentEngine(newEngine); + return browser.storage.local.set({ "kagiEngineToRedirect": newEngine }) + .then((result) => { + browser.runtime.sendMessage({ + "updatedKagiEngineToRedirect": newEngine + }); + }); +} + +engineSelect.addEventListener('change', engineToRedirectChanged); // ----------------------- // MARK: - Displaying & updating host permissions @@ -105,6 +126,47 @@ function fetchAndUpdateKnownHostList() { enabledElement.classList.toggle("enabledForThisDomain", hasKnownHosts); enabledElement.innerText = hasKnownHosts ? "enabled on:" : "disabled"; updateKnownHostList(knownHosts); + + // If the currently-redirecting engine no longer has permissions in the extension, + // reset to "All" + let enginesToDisplayInRedirectList = Array.from(document.querySelectorAll("[data-engine]")).map((en) => en.getAttribute("data-engine")); + if (engineToRedirect != "All" && enginesToDisplayInRedirectList.indexOf(engineToRedirect) < 0) { + engineToRedirect = "All"; + } + + // If we're still set to "All", update to the default + // FIXME: "All" is a fallback in case something else breaks in our stored engine setting, to make sure "Redirect to Kagi" is the fallback to broken engine selection rather than "Don't redirect if we don't have a valid engine selected". There should be a more robust solution to this that sets smart defaults or detects Safari's search engine setting. There's a way to do the latter on macOS but not iOS. + if (engineToRedirect == "All") { + updateEngineToRedirect(defaultEngineToRedirect); // Need to default to *something*. Starting w/ Google + } + + // Redirect engine list UI updates + if (knownHosts.indexOf("*://*/*") > -1) { + // TODO: Do we need custom logic for the "All websites allowed" permission? + } else { + if (enginesToDisplayInRedirectList.length > 0) { + for (let i=0;i 0) { -// let engineMatchPatterns = engineToRevoke == "All" ? ["*://*/*"] : domainMap[engineToRevoke].map((domain) => `*://*.${domain}/*`); -// revokeHostPermissions(engineMatchPatterns); -// } else { -// let hostToRevoke = evt.currentTarget.getAttribute("data-host"); -// let hostMatchPattern = `*://*.${hostToRevoke.replace(/^www\./, "")}/*`; // "www" removal should be redundant, but leaving replacement here for safety in future situations -// revokeHostPermissions([hostMatchPattern]); -// } } else { el.classList.add("readyToConfirm"); } @@ -226,32 +275,28 @@ document.onclick = function (e) { // MARK: - Onload handler // ----------------------- document.addEventListener("DOMContentLoaded", (event) => { -// browser.tabs.query({ currentWindow: true, active: true }) -// .then((tabs) => { -// if (tabs.length != 1) { -// Promise.reject(new Error("activeTab request did not return only 1 tab")); -// } -// -// console.log("Returned first tab:", tabs[0]); -// let url = new URL(tabs[0].url); -// document.getElementById("currentHost").innerText = url.hostname; -// }) - Promise.all([ - fetchAndUpdateKnownHostList(), - browser.storage.local.get("kagiPrivateSessionLink") - ]) + browser.storage.local.get(["kagiEngineToRedirect", "kagiPrivateSessionLink"]) .then((results) => { + // Fetch the current engine to redirect from local storage + if (typeof results == "object" && + typeof results["kagiEngineToRedirect"] == "string" + && results["kagiEngineToRedirect"].length > 0) { + engineToRedirect = results["kagiEngineToRedirect"]; + } // Fetch the current private session link from storage - let localPrivateSessionLink = results[1]; - if (typeof localPrivateSessionLink == "object" && - typeof localPrivateSessionLink["kagiPrivateSessionLink"] == "string" - && localPrivateSessionLink["kagiPrivateSessionLink"].length > 0) { - privateSessionLink = localPrivateSessionLink["kagiPrivateSessionLink"]; + if (typeof results == "object" && + typeof results["kagiPrivateSessionLink"] == "string" + && results["kagiPrivateSessionLink"].length > 0) { + privateSessionLink = results["kagiPrivateSessionLink"]; document.querySelector("#private-session-link").value = privateSessionLink; } + }) + .finally(() => { + selectCurrentEngine(engineToRedirect); + fetchAndUpdateKnownHostList(); }); }); -const symbolTrashBase64ImgTag = ``; \ No newline at end of file +const symbolTrashBase64ImgTag = ``; From b786c19178fad0c689ecb96c0efa304afaa6054d Mon Sep 17 00:00:00 2001 From: Nano Anderson Date: Thu, 15 Feb 2024 22:13:10 -1000 Subject: [PATCH 2/5] Bump version of Safari extension to 2.2.2 (23) --- safari/Universal/MainConfig.xcconfig | 4 ++-- safari/Universal/Shared (Extension)/Resources/manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/safari/Universal/MainConfig.xcconfig b/safari/Universal/MainConfig.xcconfig index 3f70e1c..2440996 100644 --- a/safari/Universal/MainConfig.xcconfig +++ b/safari/Universal/MainConfig.xcconfig @@ -1,3 +1,3 @@ -MARKETING_VERSION = 2.2.1 -CURRENT_PROJECT_VERSION = 22 // this needs to be increased with each version change as well (not set to 1 when version is updated) +MARKETING_VERSION = 2.2.2 +CURRENT_PROJECT_VERSION = 23 // this needs to be increased with each version change as well (not set to 1 when version is updated) PRODUCT_NAME = Kagi for Safari diff --git a/safari/Universal/Shared (Extension)/Resources/manifest.json b/safari/Universal/Shared (Extension)/Resources/manifest.json index 85e6b0b..26c52a6 100644 --- a/safari/Universal/Shared (Extension)/Resources/manifest.json +++ b/safari/Universal/Shared (Extension)/Resources/manifest.json @@ -4,7 +4,7 @@ "name": "__MSG_extension_name__", "description": "__MSG_extension_description__", - "version": "2.2.0", + "version": "2.2.2", "icons": { "512": "images/Icon.png" From bc6448dc06eab2ed6717d714cf484e1bac7496f6 Mon Sep 17 00:00:00 2001 From: Nano Anderson Date: Wed, 21 Feb 2024 15:00:15 -1000 Subject: [PATCH 3/5] Update icon to monochrome design to match Safari styles --- .../Kagi Search.xcodeproj/project.pbxproj | 8 +++-- .../Resources/background.js | 4 +-- .../Resources/images/ToolbarItemIcon.pdf | Bin 0 -> 5515 bytes .../Resources/images/ToolbarItemIcon.png | Bin 5712 -> 3818 bytes .../manifest.json | 0 .../Universal/macOS (Extension)/manifest.json | 34 ++++++++++++++++++ 6 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 safari/Universal/Shared (Extension)/Resources/images/ToolbarItemIcon.pdf rename safari/Universal/{Shared (Extension)/Resources => iOS (Extension)}/manifest.json (100%) create mode 100644 safari/Universal/macOS (Extension)/manifest.json diff --git a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj index 11116d8..3983c84 100644 --- a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj +++ b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj @@ -10,8 +10,8 @@ 3E1A51362B1734B70010A4C4 /* Kagi Search Extension iOS.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 3ED5D48F2B0DE087009DDDAD /* Kagi Search Extension iOS.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 3E1A513B2B180B890010A4C4 /* UpgradeChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1A513A2B180B890010A4C4 /* UpgradeChecker.swift */; }; 3E1A513C2B180CBE0010A4C4 /* UpgradeChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E1A513A2B180B890010A4C4 /* UpgradeChecker.swift */; }; + 3E7B281A2B86D220005EB620 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 3E7B28192B86D220005EB620 /* manifest.json */; }; 3E9DF5082B3E3E70005DF2C3 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 3ED5D55B2B0DE720009DDDAD /* manifest.json */; }; - 3E9DF5092B3E3E71005DF2C3 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 3ED5D55B2B0DE720009DDDAD /* manifest.json */; }; 3EB8FA422B61F6740052E8D4 /* Deeplinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB8FA412B61F6740052E8D4 /* Deeplinks.swift */; }; 3EB8FA432B61F6740052E8D4 /* Deeplinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EB8FA412B61F6740052E8D4 /* Deeplinks.swift */; }; 3EB8FA472B6231DC0052E8D4 /* Settings_Animation_dark.gif in Resources */ = {isa = PBXBuildFile; fileRef = 3EB8FA452B6231DB0052E8D4 /* Settings_Animation_dark.gif */; }; @@ -133,6 +133,7 @@ /* Begin PBXFileReference section */ 3E1A513A2B180B890010A4C4 /* UpgradeChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpgradeChecker.swift; sourceTree = ""; }; + 3E7B28192B86D220005EB620 /* manifest.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = manifest.json; sourceTree = ""; }; 3EB8FA412B61F6740052E8D4 /* Deeplinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deeplinks.swift; sourceTree = ""; }; 3EB8FA452B6231DB0052E8D4 /* Settings_Animation_dark.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Settings_Animation_dark.gif; sourceTree = ""; }; 3EB8FA462B6231DB0052E8D4 /* Settings_Animation_light.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = Settings_Animation_light.gif; sourceTree = ""; }; @@ -341,7 +342,6 @@ 3ED5D5552B0DE720009DDDAD /* popup.js */, 3ED5D5562B0DE720009DDDAD /* background.js */, 3ED5D55A2B0DE720009DDDAD /* popup.html */, - 3ED5D55B2B0DE720009DDDAD /* manifest.json */, 3ED5D55C2B0DE720009DDDAD /* popup.css */, ); path = Resources; @@ -350,6 +350,7 @@ 3ED5D5772B0DE75F009DDDAD /* iOS (Extension) */ = { isa = PBXGroup; children = ( + 3ED5D55B2B0DE720009DDDAD /* manifest.json */, 3ED5D4C92B0DE324009DDDAD /* Kagi Search Extension (iOS).entitlements */, 3ED5D5782B0DE75F009DDDAD /* Info.plist */, ); @@ -359,6 +360,7 @@ 3ED5D5792B0DE75F009DDDAD /* macOS (Extension) */ = { isa = PBXGroup; children = ( + 3E7B28192B86D220005EB620 /* manifest.json */, 3ED5D57A2B0DE75F009DDDAD /* Kagi Search Extension (macOS).entitlements */, 3ED5D57B2B0DE75F009DDDAD /* Info.plist */, 3E1A513A2B180B890010A4C4 /* UpgradeChecker.swift */, @@ -599,9 +601,9 @@ buildActionMask = 2147483647; files = ( 3ED5D5722B0DE720009DDDAD /* popup.css in Resources */, - 3E9DF5092B3E3E71005DF2C3 /* manifest.json in Resources */, 3ED5D58F2B0DFC34009DDDAD /* _locales in Resources */, 3ED5D56E2B0DE720009DDDAD /* popup.html in Resources */, + 3E7B281A2B86D220005EB620 /* manifest.json in Resources */, 3ED5D5682B0DE720009DDDAD /* background.js in Resources */, 3ED5D5922B0DFC81009DDDAD /* images in Resources */, 3ED5D5662B0DE720009DDDAD /* popup.js in Resources */, diff --git a/safari/Universal/Shared (Extension)/Resources/background.js b/safari/Universal/Shared (Extension)/Resources/background.js index 9b28aab..b6e373e 100644 --- a/safari/Universal/Shared (Extension)/Resources/background.js +++ b/safari/Universal/Shared (Extension)/Resources/background.js @@ -441,12 +441,12 @@ function getPreferencesFromStorage(callback) { browser.storage.local.get(["kagiPrivateSessionLink","kagiEngineToRedirect"], function(value) { // Private session link var link = value.kagiPrivateSessionLink; - if (typeof (link) !== "undefined") { + if (typeof (link) == "string") { updatePrivateSessionLink(link); } // Engine to redirect var engine = value.kagiEngineToRedirect; - if (typeof (engine) !== "undefined") { + if (typeof (engine) == "string") { if (engine == "All" || supportedEngineNames.indexOf(engine) < 0) { currentEngine = defaultEngineToRedirect; // default to redirecting Google } else { diff --git a/safari/Universal/Shared (Extension)/Resources/images/ToolbarItemIcon.pdf b/safari/Universal/Shared (Extension)/Resources/images/ToolbarItemIcon.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9ee31b959d194e895f0b6495856cd395bdec3767 GIT binary patch literal 5515 zcmai&2UJs8x5ooS2~|{z0uBKI=_C+JL|P~zfYPMbKtgXq=prqE2uP74C?G|uv;hG@ zdM^XgL7GVKRjSAfGvoK1H}9=?*IhSv?fpOdo_qFP*}r`_)a4cVp#s9>94!mG3u`%h zZ$7oOkqd(%U?+21@_YBdf{HfwIIIid*B*_-%402@Fj%mlD%Q~oXAOpmiNnECQsk~U z7cAO=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Agh=l&z) zd!xvv9d%*wNRiRRhX)?Ujn%W?>eiwhzz#~|+ue%Ykyxe~$7j<+8gDd8>ddUmwieqE z9}pU|wfwz?)b_3RboLulmSu&u6Nzjl{ol;Hzdrk_#xWVYHly#Wdpy;1fZwQnd+_$u zhM>sB)p)-)ohNZIQz{ zt68f7j8VypwW~gr8!4aLCr0aM9Q+1}B1u|FrGBGj{^-|nsBTv%>(GjxoPF2ax0bP5 zU2o-Q>L`v*JIPa;x_izx1o~ z$NLcnNy%khRw{ily>zc%!P7jR>>}ENcf!LMLhtJ0q^is32U3bkil(~*5{pfCKDgvf z)SiCVPAsr0f*VWtruf!wgq%f={8p2iV7mUqX65~sL+y%l*;&F|;q$snzDp;@r-IW5 z)xHbQ&r_I4!Y`j}3e@?Wn@mcs_)eeoljdD9k?!#pKeIlwSf9(dL$1b?nlD{=HheT{ znOD2N{$|vyuk5K+R7jPa;CcLUv0C$`zPvtO#d5_}WFfLI;y7Z;yL7*GyE`Ira4xu> z`$xrLe1AdO6OYqcEA!5lZM*)pBx&X8+&cKl$brKWW_fU2vk@= z1Z>2GaI>+;fQ5vRVlX3au!bAj1?LSWv;cp04W2k|0{Ij6;&6nA$P-AMoJ;<$5JU(D z5rT?A#i1|=+yDZ(LpTY#`%ah(3Hbk({CDf&>4LQ+CoBkr9P*z7EGi-*ECRL!|80Yc zixWDOiv#TV(*_e4`Iij>5hASrKXp*J=)ZI@aVTM3{;3m!h!PU>KWtD4A-(^!!Qh0M z{mTX?r0J&)=YqDe$GZHv#i?cEjU~Jrp%-&q%M-GGPs{=X zvxGxLU}9*DB}^16j)g)+#YE8%m?Z`(424UP|NoM|z8Y5?A#H!IsR&dAPR_xhpr%Ov EU%#Tmc>n+a literal 0 HcmV?d00001 diff --git a/safari/Universal/Shared (Extension)/Resources/images/ToolbarItemIcon.png b/safari/Universal/Shared (Extension)/Resources/images/ToolbarItemIcon.png index 7f6749d93d52038ff593f3740e5bfcf3bcf6df0c..f150bdd1a9dada6132e51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qh3S+SK24(6WGbd6ZcJQl+iFMbP_q5}khuFN6?Hq7_s?;?}3uu|$c@)!G3 z^RwGDK~2y~w@R3nWNE?o%yc8$S*>yc<8Bgi2-BVSnnuV|4vba|lN_;JK>WJ#2kVyFhZh`IMPet85* zC#>w*#^t*H9y`1|_&%pf(~(W%7XS(RRV8^)G{92#4poA7@0fB|lSD3vJjP%@Sl|!c z8|q@Qc-;~S5PJZ`e@!7| z{|T8RDk1uSOP7K30XHMbY>1Q~$Df{wkb;NE@2b}P(D=}nMxOj!T%v-Mle19N{i8|h zfT`sRvIKBc48Q?Qq&{3Y*!`|tN->*diuI6U?VkebNQ-8?Yu7Gr3b(W0Q9T-0x+n$h zl0%~!$`kE^O6>1Pq~~J4G&DxpL&kS@4nnOzOp)TxG1xtg-~f= zkea&&o=nSHIU5$8`K@|u4TBLS%yg-J>CG*x{ozUltY9I=M$$&@eJ`l{r2J*P=G2X* zq3}~+A_#fx`u+2Ok=8rcfN*JyU|7(H=9asqVhRfWPs&GnVa7Zd097_f15qf+k!j;O z)=;8s&O%%OVXUYfLF2@{`DN9J|VbahnvR;(GUYagMW%rGwT6kTWlCm`KMJh*e%`8i&YhnUu*Pg5r#M}5jF_7bVV!K$T{lkZe z+%8#I!0Ky>{D$?trQ;@HNidya*Hfp>?GZ@Bg4CGsbDu5-O94ZukjUqn*R3|(Q*{by zd+BdQ(<8qQC$JdJd=D1tAJ#D)AnpI)s$FvbbAG$~OM;wQLGd7UoJmH(hx(}YcR!qy zl2TND&0>+wa(fy}p-#S7RZ77y)(eH|Z|;U|b#&576iFekxKzIxkEb^3l`A*i=x{>2 zn9&w|%X~wcmbqJve{vmZ1ftHGCZ48Z>N<1ceU9Ql9Udh)n{ZPzr*Y!#2AsEe2I6~F zk#%9y#$%&cwr%f74tg Mc{RE6SLVV01FpKvUjP6A diff --git a/safari/Universal/Shared (Extension)/Resources/manifest.json b/safari/Universal/iOS (Extension)/manifest.json similarity index 100% rename from safari/Universal/Shared (Extension)/Resources/manifest.json rename to safari/Universal/iOS (Extension)/manifest.json diff --git a/safari/Universal/macOS (Extension)/manifest.json b/safari/Universal/macOS (Extension)/manifest.json new file mode 100644 index 0000000..c864027 --- /dev/null +++ b/safari/Universal/macOS (Extension)/manifest.json @@ -0,0 +1,34 @@ +{ + "manifest_version": 2, + "default_locale": "en", + + "name": "__MSG_extension_name__", + "description": "__MSG_extension_description__", + "version": "2.2.2", + + "icons": { + "512": "images/Icon.png" + }, + + "background": { + "scripts": [ + "background.js" + ], + "persistent": false + }, + + "browser_action": { + "default_popup": "popup.html", + "default_icon": { + "128": "images/ToolbarItemIcon.pdf" + } + }, + + "permissions": [ + "nativeMessaging", + "webNavigation", + "storage" + ], + + "optional_permissions": [] +} From 48cc538233f99982f955855aafb46474c36f80d1 Mon Sep 17 00:00:00 2001 From: Nano Anderson Date: Wed, 21 Feb 2024 15:01:27 -1000 Subject: [PATCH 4/5] Bump build number --- .../{ => Kagi Search (macOS)}/Kagi-Search-macOS-Info.plist | 0 safari/Universal/Kagi Search.xcodeproj/project.pbxproj | 4 ++-- safari/Universal/MainConfig.xcconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename safari/Universal/{ => Kagi Search (macOS)}/Kagi-Search-macOS-Info.plist (100%) diff --git a/safari/Universal/Kagi-Search-macOS-Info.plist b/safari/Universal/Kagi Search (macOS)/Kagi-Search-macOS-Info.plist similarity index 100% rename from safari/Universal/Kagi-Search-macOS-Info.plist rename to safari/Universal/Kagi Search (macOS)/Kagi-Search-macOS-Info.plist diff --git a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj index 3983c84..9110c66 100644 --- a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj +++ b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj @@ -142,7 +142,7 @@ 3EC41D232B21B587009B17FE /* macOS Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "macOS Assets.xcassets"; sourceTree = ""; }; 3EC772502B2C48CE00E40354 /* Kagi Search iOS copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Kagi Search iOS copy-Info.plist"; path = "/Users/nano/Kagi/kagi-for-safari-macos/Kagi Search iOS copy-Info.plist"; sourceTree = ""; }; 3EC772622B2C492F00E40354 /* Kagi Search Extension iOS copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Kagi Search Extension iOS copy-Info.plist"; path = "/Users/nano/Kagi/kagi-for-safari-macos/Kagi Search Extension iOS copy-Info.plist"; sourceTree = ""; }; - 3EC772662B2F904200E40354 /* Kagi-Search-macOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Kagi-Search-macOS-Info.plist"; sourceTree = ""; }; + 3EC772662B2F904200E40354 /* Kagi-Search-macOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Kagi-Search-macOS-Info.plist"; sourceTree = ""; }; 3ED5D48F2B0DE087009DDDAD /* Kagi Search Extension iOS.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Kagi Search Extension iOS.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 3ED5D4AC2B0DE2BD009DDDAD /* Kagi Search Extension macOS.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Kagi Search Extension macOS.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; 3ED5D4C92B0DE324009DDDAD /* Kagi Search Extension (iOS).entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Kagi Search Extension (iOS).entitlements"; sourceTree = ""; }; @@ -298,6 +298,7 @@ 3ED5D4FE2B0DE6A5009DDDAD /* Kagi Search (macOS) */ = { isa = PBXGroup; children = ( + 3EC772662B2F904200E40354 /* Kagi-Search-macOS-Info.plist */, 3ED5D4FF2B0DE6A5009DDDAD /* NSWindow+Helpers.swift */, 3ED5D5002B0DE6A5009DDDAD /* Main.storyboard */, 3ED5D5022B0DE6A5009DDDAD /* AppDelegate.swift */, @@ -371,7 +372,6 @@ C31E69142823DD4E00B1491B = { isa = PBXGroup; children = ( - 3EC772662B2F904200E40354 /* Kagi-Search-macOS-Info.plist */, C39A9F7028588C0100E4C0A3 /* MainConfig.xcconfig */, 3ED5D5772B0DE75F009DDDAD /* iOS (Extension) */, 3ED5D5792B0DE75F009DDDAD /* macOS (Extension) */, diff --git a/safari/Universal/MainConfig.xcconfig b/safari/Universal/MainConfig.xcconfig index 2440996..9c8b7de 100644 --- a/safari/Universal/MainConfig.xcconfig +++ b/safari/Universal/MainConfig.xcconfig @@ -1,3 +1,3 @@ MARKETING_VERSION = 2.2.2 -CURRENT_PROJECT_VERSION = 23 // this needs to be increased with each version change as well (not set to 1 when version is updated) +CURRENT_PROJECT_VERSION = 24 // this needs to be increased with each version change as well (not set to 1 when version is updated) PRODUCT_NAME = Kagi for Safari From ec385047dbf7c59a7509eb69e379e63afe9a28f7 Mon Sep 17 00:00:00 2001 From: Nano Anderson Date: Wed, 21 Feb 2024 15:13:43 -1000 Subject: [PATCH 5/5] Fix location of macOS plist --- safari/Universal/Kagi Search.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj index 9110c66..7aec629 100644 --- a/safari/Universal/Kagi Search.xcodeproj/project.pbxproj +++ b/safari/Universal/Kagi Search.xcodeproj/project.pbxproj @@ -1279,7 +1279,7 @@ "DEVELOPMENT_TEAM[sdk=macosx*]" = TFVG979488; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "Kagi-Search-macOS-Info.plist"; + INFOPLIST_FILE = "Kagi Search (macOS)/Kagi-Search-macOS-Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = ""; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = "Kagi Search is a quick, user-centric, 100% privacy-respecting search engine with results augmented by non-commercial indexes and personalized searches."; @@ -1322,7 +1322,7 @@ "DEVELOPMENT_TEAM[sdk=macosx*]" = TFVG979488; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "Kagi-Search-macOS-Info.plist"; + INFOPLIST_FILE = "Kagi Search (macOS)/Kagi-Search-macOS-Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = ""; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_NSHumanReadableCopyright = "Kagi Search is a quick, user-centric, 100% privacy-respecting search engine with results augmented by non-commercial indexes and personalized searches.";