Yo saveData, getData.
This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/489971/1343998/Save%20and%20Get.js
// ==UserScript== // @name Save and Get // @namespace none // @version 0.1 // @description Yo saveData, getData. // @author no // @match *://*/* // @grant unsafeWindow // ==/UserScript== (() => { 'use strict'; unsafeWindow.saveData = (key, value) => { localStorage.setItem(key, JSON.stringify(value)); }; unsafeWindow.getData = (keysArray) => { const data = {}; keysArray.forEach(key => { try { const value = localStorage.getItem(key); if (value !== null) { data[key] = JSON.parse(value); } } catch (error) { console.error('Ошибка при загрузке данных:', error); } }); return data; }; })();