online.git: browser/js

0 views
Skip to first unread message

"Andras Timar (via cogerrit)"

unread,
Apr 23, 2026, 3:16:50 AM (6 days ago) Apr 23
to collaboraon...@googlegroups.com
browser/js/global.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 61718fca174489f93fc317200a9fc2fa4c63f241
Author: Andras Timar <andras...@collabora.com>
AuthorDate: Wed Apr 22 16:21:35 2026 +0200
Commit: Miklos Vajna <vmi...@collabora.com>
CommitDate: Thu Apr 23 07:16:06 2026 +0000

browser: fix uncaught TypeError when prefs are re-read after remove()

prefs.remove(key) stored undefined into _localStorageCache[key] instead
of deleting the entry. A subsequent prefs.get(key, default) then saw the
key as present (key in cache) and returned the cached undefined,
ignoring the caller-supplied default. prefs.getBoolean then called
.toLowerCase() on that undefined and surfaced as a "Cannot read
properties of undefined" exception popup during viewinfo handling
(reproduced by Map.Welcome.shouldWelcome, which itself remove()s the
expired WSDWelcomeDisabled key and re-reads it on the next tick).

Fix remove() to actually delete the cache entry, and treat an undefined
cached value in get() as a miss so any residual poisoning can no longer
short-circuit the default.

Signed-off-by: Andras Timar <andras...@collabora.com>
Change-Id: I5f2dac719c26cc879829a0572c50ceb877e15cfd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1394
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmi...@collabora.com>

diff --git a/browser/js/global.js b/browser/js/global.js
index d3413cef86fc..752b862ac42e 100644
--- a/browser/js/global.js
+++ b/browser/js/global.js
@@ -896,7 +896,7 @@ function showWelcomeSVG() {
},

get: function(key, defaultValue = undefined) {
- if (key in global.prefs._localStorageCache) {
+ if (global.prefs._localStorageCache[key] !== undefined) {
return global.prefs._localStorageCache[key];
}

@@ -996,7 +996,7 @@ function showWelcomeSVG() {
if (global.prefs.canPersist) {
global.localStorage.removeItem(key);
}
- global.prefs._localStorageCache[key] = undefined;
+ delete global.prefs._localStorageCache[key];
},

getBoolean: function(key, defaultValue = false) {

"Ashod Nakashian (via cogerrit)"

unread,
Apr 28, 2026, 8:58:14 AM (22 hours ago) Apr 28
to collaboraon...@googlegroups.com
browser/js/global.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 89b7e8bc77b6914f71a34e9dceb3d83c2d0ae1c4
Author: Ashod Nakashian <ashod.n...@collabora.co.uk>
AuthorDate: Fri Apr 24 05:29:31 2026 -0400
Commit: Ashod Nakashian <ashod.n...@collabora.co.uk>
CommitDate: Tue Apr 28 12:57:50 2026 +0000

browser: support non-wopi url and undefined accessTokenTtl

Change-Id: Ieb4cc1a38a1e6322dd319c98df91c4d4a9fc93cf
Signed-off-by: Ashod Nakashian <ashod.n...@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1704
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan....@collabora.com>
Tested-by: Caolán McNamara <caolan....@collabora.com>

diff --git a/browser/js/global.js b/browser/js/global.js
index 541478cdd0a1..fe1045a85887 100644
--- a/browser/js/global.js
+++ b/browser/js/global.js
@@ -248,7 +248,7 @@ class InitializerBase {
window.hexifyUrl = false;
window.versionPath = "";
window.accessToken = element.dataset.accessToken;
- window.accessTokenTTL = element.dataset.accessTokenTtl;
+ window.accessTokenTTL = element.dataset.accessTokenTtl || '0';
window.noAuthHeader = element.dataset.noAuthHeader;
window.accessHeader = element.dataset.accessHeader;
window.postMessageOriginExt = "";
@@ -1917,7 +1917,7 @@ function showWelcomeSVG() {
global.webserver = global.webserver.replace(/\/*$/, ''); // Remove trailing slash.
}

- var docParams, wopiParams;
+ var docParams = '', wopiParams;
var filePath = global.coolParams.get('file_path');
global.wopiSrc = global.coolParams.get('WOPISrc');
if (global.wopiSrc != '') {
@@ -1981,7 +1981,8 @@ function showWelcomeSVG() {
wopiSrc += '&RouteToken=' + global.routeToken;
}

- return root + '/ws' + wopiSrc + '&' + docParams;
+ var separator = wopiSrc ? '&' : (docParams ? '?' : '');
+ return root + '/ws' + wopiSrc + separator + docParams;
};

// Form a valid WS URL to the host with the given path and

Reply all
Reply to author
Forward
0 new messages