From 2c7cd3a8d2e2a5327799424c88926cae718796ed Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Sat, 22 Feb 2025 12:22:34 +0100 Subject: [PATCH 1/3] chore(linux): Update to new Debian policy version --- linux/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/debian/control b/linux/debian/control index e6bc47bdb8..71172ddc3b 100644 --- a/linux/debian/control +++ b/linux/debian/control @@ -42,7 +42,7 @@ Build-Depends: python3-xdg, xserver-xephyr, xvfb, -Standards-Version: 4.7.0 +Standards-Version: 4.7.1 Vcs-Git: https://github.com/keymanapp/keyman.git -b beta [linux/debian] Vcs-Browser: https://github.com/keymanapp/keyman/tree/beta/linux/debian Homepage: https://www.keyman.com From f3946ffc76d2869417e6b71cdd7feefc38d9f6a4 Mon Sep 17 00:00:00 2001 From: Joshua Horton Date: Mon, 24 Feb 2025 12:37:09 +0700 Subject: [PATCH 2/3] fix(web): prevent cookie-default behavior from mangling engine init Fixes: #13278 The fallback default keyboard corresponding to an uninitialized cookie is `Keyboard_us:en`. This should only occur if the site actually registers its stub before initialization - and we weren't checking/filtering for this properly. The error itself only occurred if there _were_ stubs pre-registered before init - if none existed, the error does not result. --- web/src/app/browser/src/contextManager.ts | 7 +- web/src/app/browser/src/keymanEngine.ts | 19 +- .../manual/web/issue11785/clear-cookies.js | 16 ++ web/src/test/manual/web/issue11785/index.html | 7 +- .../manual/web/issue11785/load-keyboards.js | 171 ++++++++++++++++++ 5 files changed, 210 insertions(+), 10 deletions(-) create mode 100644 web/src/test/manual/web/issue11785/clear-cookies.js create mode 100644 web/src/test/manual/web/issue11785/load-keyboards.js diff --git a/web/src/app/browser/src/contextManager.ts b/web/src/app/browser/src/contextManager.ts index c2254c1fdd..711a1b718e 100644 --- a/web/src/app/browser/src/contextManager.ts +++ b/web/src/app/browser/src/contextManager.ts @@ -759,7 +759,7 @@ export default class ContextManager extends ContextManagerBase 0) { + var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path='; + var p = location.pathname.split('/'); + document.cookie = cookieBase + '/'; + while (p.length > 0) { + document.cookie = cookieBase + p.join('/'); + p.pop(); + }; + d.shift(); + } + } +} \ No newline at end of file diff --git a/web/src/test/manual/web/issue11785/index.html b/web/src/test/manual/web/issue11785/index.html index bd82343ca9..5df453aab9 100644 --- a/web/src/test/manual/web/issue11785/index.html +++ b/web/src/test/manual/web/issue11785/index.html @@ -35,7 +35,8 @@ - + +