The AxiomAPI class handles premium key validation, key storage, and user dialogs.
Handles the callback after a dialog interaction. Removes the dialog element from the DOM.
- Parameters:
callback(function): The callback function to execute.
Asynchronously checks if a given premium key is valid by making a POST request to /api/premium/check.
- Parameters:
key(string): The premium key to validate.
- Returns: Promise -
trueif the key is valid,falseotherwise.
Stores the premium key in localStorage.
- Parameters:
key(string): The premium key to store.
Displays a modal dialog with a message and two buttons (positive and negative). Executes the callback with the button text when clicked.
- Parameters:
message(string): The message to display in the dialog.positive(string): Text for the positive button.negative(string): Text for the negative button.callback(function): Function to call with the clicked button's text as argument.
The AxiomPluginManager class manages plugin registration and browser settings.
Registers a plugin if it meets the requirements (version not deprecated, has author and name).
- Parameters:
plugin(object): The plugin object with propertiesversion,author,name.
Sets the proxy type for the browser.
- Parameters:
proxy(string): Must be one of "uv", "scramjet", or "oxygen".
- Behavior: Stores the proxy in localStorage as 'axiomProxy'.
Sets the homepage type.
- Parameters:
homepage(string): Must be "start", "games", or "custom".customUrl(string, optional): The custom URL if homepage is "custom".
- Behavior: Stores homepage in localStorage as 'axiomHomepage', and customUrl as 'axiomCustomHomepage' if applicable.
Sets the theme.
- Parameters:
theme(string): The theme value to set.
- Behavior: Stores theme in localStorage as 'axiomTheme'.
Resets all settings to defaults after user confirmation via dialog. Clears localStorage and cookies, then reloads the page.
- Parameters: None.
window.axiom: Instance ofAxiomAPI.window.axiomPluginAPI: Instance ofAxiomPluginManager.