diff --git a/chrome/dashboard.js b/chrome/dashboard.js index 1fcc6c9..a87a0bb 100644 --- a/chrome/dashboard.js +++ b/chrome/dashboard.js @@ -254,7 +254,9 @@ async function importCookies(items, onProg) { d.partitionKey = { topLevelSite: c.partitionKey.topLevelSite }; // The ancestor bit changes which embedding contexts can read it; // dropping it would move third-party cookies between partitions. - if (typeof c.partitionKey.hasCrossSiteAncestor === "boolean") { + // Firefox's schema (115-140 ESR) has no hasCrossSiteAncestor and + // rejects unknown properties, so only Chrome gets it. + if (!IS_FIREFOX && typeof c.partitionKey.hasCrossSiteAncestor === "boolean") { d.partitionKey.hasCrossSiteAncestor = c.partitionKey.hasCrossSiteAncestor; } } @@ -421,7 +423,7 @@ function buildBundle() { const st = exState[id]; if (st.selected && st.data != null) { data[id] = st.data; counts[id] = st.count; } } - return { portage: { format: "portage-bundle", version: 1, source: SOURCE, generator: `Portage ${SOURCE_LABEL} 2.0.0`, exportedAt: new Date().toISOString(), userAgent: navigator.userAgent }, meta: { counts }, data }; + return { portage: { format: "portage-bundle", version: 1, source: SOURCE, generator: `Portage ${SOURCE_LABEL} 2.1.0`, exportedAt: new Date().toISOString(), userAgent: navigator.userAgent }, meta: { counts }, data }; } function updateExportTotals() { diff --git a/chrome/manifest.json b/chrome/manifest.json index 7636bb9..925c42b 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Portage", - "version": "2.0.0", + "version": "2.1.0", "description": "Export bookmarks, history, cookies, tabs, sessions, and reading list to a portable JSON file. Import on any browser.", "homepage_url": "https://github.com/pvrzz/Portage/", "permissions": [ diff --git a/firefox/dashboard.js b/firefox/dashboard.js index f4f6786..73aed07 100644 --- a/firefox/dashboard.js +++ b/firefox/dashboard.js @@ -257,7 +257,9 @@ async function importCookies(items, onProg) { d.partitionKey = { topLevelSite: c.partitionKey.topLevelSite }; // The ancestor bit changes which embedding contexts can read it; // dropping it would move third-party cookies between partitions. - if (typeof c.partitionKey.hasCrossSiteAncestor === "boolean") { + // Firefox's schema (115-140 ESR) has no hasCrossSiteAncestor and + // rejects unknown properties, so only Chrome gets it. + if (!IS_FIREFOX && typeof c.partitionKey.hasCrossSiteAncestor === "boolean") { d.partitionKey.hasCrossSiteAncestor = c.partitionKey.hasCrossSiteAncestor; } } @@ -424,7 +426,7 @@ function buildBundle() { const st = exState[id]; if (st.selected && st.data != null) { data[id] = st.data; counts[id] = st.count; } } - return { portage: { format: "portage-bundle", version: 1, source: SOURCE, generator: `Portage ${SOURCE_LABEL} 2.0.0`, exportedAt: new Date().toISOString(), userAgent: navigator.userAgent }, meta: { counts }, data }; + return { portage: { format: "portage-bundle", version: 1, source: SOURCE, generator: `Portage ${SOURCE_LABEL} 2.1.0`, exportedAt: new Date().toISOString(), userAgent: navigator.userAgent }, meta: { counts }, data }; } function updateExportTotals() { diff --git a/firefox/manifest.json b/firefox/manifest.json index 35b78c3..198a09b 100644 --- a/firefox/manifest.json +++ b/firefox/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Portage", - "version": "2.0.1", + "version": "2.1.0", "description": "Universal browser data swap. Export bookmarks, history, cookies, tabs and sessions to a portable JSON bundle, then import into any browser running Portage — Firefox to Chrome, or the same browser on a new machine. Also exports your add-on list as a reinstall checklist.", "homepage_url": "https://github.com/pvrzz/Portage/", "browser_specific_settings": { diff --git a/tests/test_storage_browser.cjs b/tests/test_storage_browser.cjs index 986c95c..f49b41e 100644 --- a/tests/test_storage_browser.cjs +++ b/tests/test_storage_browser.cjs @@ -84,7 +84,8 @@ async function main() { assert.deepEqual(names, firefox ? ['plain', 'partitioned', 'fpi'] : ['plain', 'partitioned']); for (const details of written) assert.equal(details.storeId, defaultStoreId); assert.equal('sameSite' in written[0], false, 'unspecified must omit the attribute'); - assert.equal(written.find((details) => details.name === 'partitioned').partitionKey.hasCrossSiteAncestor, true); + assert.equal(written.find((details) => details.name === 'partitioned').partitionKey.hasCrossSiteAncestor, firefox ? undefined : true, + 'Firefox 115-140 rejects hasCrossSiteAncestor; Chrome keeps it'); if (firefox) { assert.equal(written[0].firstPartyDomain, ''); assert.equal(written.find((details) => details.name === 'fpi').firstPartyDomain, 'example.com');