mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Add browser-specific entry point
This commit is contained in:
@@ -4,6 +4,7 @@ export const Directions = {
|
||||
};
|
||||
|
||||
let debugMode = location.hostname === "127.0.0.1";
|
||||
let context = null;
|
||||
|
||||
/**
|
||||
* @returns {boolean} Whether debug mode is enabled
|
||||
@@ -19,6 +20,17 @@ export function setDebug(value) {
|
||||
debugMode = value;
|
||||
}
|
||||
|
||||
export function getContext() {
|
||||
if (!context) {
|
||||
throw new Error("Context requested before being set");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function setContext(newContext) {
|
||||
context = newContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an HTML element with the specified parameters
|
||||
* @param {string} className
|
||||
|
||||
Reference in New Issue
Block a user