BTHLABS-50: Safari Web extension

Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl>
Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
2025-09-08 18:11:36 +00:00
committed by Tomek Wójcik
parent ffecf780ee
commit b6d02dbe78
184 changed files with 7536 additions and 163 deletions

View File

@@ -0,0 +1,34 @@
const ENV = __HOTPOCKET_EXTENSION_ENV__;
const DEBUG = (ENV === 'development') ? true : false;
const noop = () => {};
const HotPocketExtension = {
platform: null,
version: __HOTPOCKET_EXTENSION_VERSION__,
debug: DEBUG,
api: null,
base_url: __HOTPOCKET_EXTENSION_BASE_URL__,
LOGGER: {
// eslint-disable-next-line no-console
debug: (DEBUG === true) ? console.log : noop,
error: console.error,
info: console.info,
warning: console.warn,
},
configure: ({platform, debug, api}, options) => {
options = options || {};
HotPocketExtension.platform = platform;
HotPocketExtension.debug = debug;
HotPocketExtension.api = api;
const background = (options.background === true) ? true : false;
if (background === false && HotPocketExtension.debug === true) {
window.HotPocketExtension = HotPocketExtension;
}
},
};
export default HotPocketExtension;