From f3d6a21e7abfd0e5ad584cc9e6c15bf24d2e05a6 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 13 Nov 2023 10:36:55 -0500 Subject: [PATCH] Add `trusted-set-session-storage-item` scriptlet Related discussion: https://github.com/uBlockOrigin/uAssets/issues/20630#issuecomment-1807390945 --- assets/resources/scriptlets.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 547c97988..cf319375c 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -3870,6 +3870,19 @@ function trustedSetLocalStorageItem(key = '', value = '') { setLocalStorageItemFn('local', true, key, value); } +builtinScriptlets.push({ + name: 'trusted-set-session-storage-item.js', + requiresTrust: true, + fn: trustedSetSessionStorageItem, + world: 'ISOLATED', + dependencies: [ + 'set-local-storage-item.fn', + ], +}); +function trustedSetSessionStorageItem(key = '', value = '') { + setLocalStorageItemFn('session', true, key, value); +} + /******************************************************************************* * * trusted-replace-fetch-response.js