Skip to content

Commit a5c9696

Browse files
Support version from platform object (#1961)
* Trim whitespace from links * Don't create context chip if context has been used * Add belt and braces fix for enter submission * Add selected text, buggy * Add in version support from platform position * Remove stale work * Fix: Improve platform version handling Co-authored-by: jkingston <[email protected]> * Revert "Fix: Improve platform version handling" This reverts commit d8bc215. --------- Co-authored-by: Cursor Agent <[email protected]>
1 parent 2f19106 commit a5c9696

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

injected/docs/platform-integration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ The following placeholders are replaced during the build process:
6464
- **`$CONTENT_SCOPE$`** - Raw remote config object
6565
- **`$USER_UNPROTECTED_DOMAINS$`** - An array of user allowlisted domains
6666
- **`$USER_PREFERENCES$`** - An object containing:
67-
- `platform`: `{ name: '<ios | macos | extension | android | windows>', internal: <boolean> }`
67+
- `platform`:
68+
- `name`: '<ios | macos | extension | android | windows>',
69+
- `internal`: <boolean>
70+
- `version`: <string | number>
6871
- `debug`: boolean
6972
- `globalPrivacyControlValue`: boolean
7073
- `sessionKey`: `<CSRNG UUID 4 string>` (used for fingerprinting) - this should regenerate on browser close or every 24 hours

injected/src/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ export function computeLimitedSiteObject() {
591591
* @returns {string | number | undefined}
592592
*/
593593
function getPlatformVersion(preferences) {
594+
// Check for platform.version first
595+
if (preferences.platform?.version !== undefined && preferences.platform?.version !== '') {
596+
return preferences.platform.version;
597+
}
598+
// Fallback to legacy version fields
594599
if (preferences.versionNumber) {
595600
return preferences.versionNumber;
596601
}

0 commit comments

Comments
 (0)