safari-mcp 2.22.11 → 2.22.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extension/background.js +9 -2
- package/package.json +1 -1
package/extension/background.js
CHANGED
|
@@ -125,7 +125,10 @@ function _safeTabUrl(rawUrl) {
|
|
|
125
125
|
|
|
126
126
|
function _receiptOrigin(rawUrl) {
|
|
127
127
|
const raw = String(rawUrl || "");
|
|
128
|
-
|
|
128
|
+
// Safari leaves `url` off a blank tab (measured 7.10.26). Read as no origin at all, the
|
|
129
|
+
// about:blank receipt of a fresh safari_new_tab() was refused on its first command, and
|
|
130
|
+
// getReceipt could not rotate it: the tab could be neither used nor closed.
|
|
131
|
+
if (!raw || raw === "about:blank") return "about:blank";
|
|
129
132
|
try {
|
|
130
133
|
const parsed = new URL(raw);
|
|
131
134
|
return /^https?:$/.test(parsed.protocol) ? parsed.origin : "";
|
|
@@ -914,7 +917,11 @@ async function handleCommand(type, payload) {
|
|
|
914
917
|
const suppliedReceipt = (type === "new_tab" || type === "list_tabs")
|
|
915
918
|
? ""
|
|
916
919
|
: _receiptTokenFromPayload(payload);
|
|
917
|
-
|
|
920
|
+
// getReceipt and close_tab use a receipt only to find its tab; neither runs anything in the
|
|
921
|
+
// page. close_tab was held to the receipt's origin, so a tab a redirect or login bounce had
|
|
922
|
+
// moved could be closed only after a getReceipt rotation, and a page with no http(s) origin
|
|
923
|
+
// never gets one: the tab stayed open with nothing able to close it (geo-audit, 6.10.26).
|
|
924
|
+
const allowReceiptOriginChange = type === "get_tab_receipt" || type === "close_tab";
|
|
918
925
|
let receiptResolved = false;
|
|
919
926
|
// new_tab CREATES its target, so a failure to resolve an existing one must not stop
|
|
920
927
|
// it. Once a profile holds several windows, resolution legitimately fails with
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "safari-mcp",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.13",
|
|
4
4
|
"mcpName": "io.github.achiya-automation/safari-mcp",
|
|
5
5
|
"description": "Safari browser automation for AI agents — native macOS, zero Chrome overhead. 98 tools via AppleScript + JavaScript.",
|
|
6
6
|
"type": "module",
|