Cloak Module Documentation

Manage document title and favicon with ease.

Functions

getFavicon()

Retrieves the current favicon URL of the document.

Example:


const faviconUrl = cloak.getFavicon();
console.log(faviconUrl); // Outputs the current favicon URL

                

setFavicon(url)

Sets the favicon of the document to the provided URL.

Example:


cloak.setFavicon("https://example.com/new-favicon.ico");

                

getTitle()

Returns the current title of the document.

Example:


const title = cloak.getTitle();
console.log(title); // Outputs the current document title

                

setTitle(title)

Sets the title of the document to the provided string.

Example:


cloak.setTitle("New Document Title");

                

setCloak(title, url)

Sets both the title and favicon of the document and saves them in localStorage.

Example:


cloak.setCloak("My Awesome Page", "https://example.com/favicon.ico");

                

init()

Initializes the cloak settings by retrieving values from localStorage.

Example:


document.addEventListener("DOMContentLoaded", () => {
    cloak.init(); // Call this to set initial cloak settings
});

                

aboutBlank(url)

Opens the current tab in an about:blank iframe. If no URL is provided, it defaults to https://www.google.com/search?q=how+many+seconds+in+a+day.

Example:


cloak.aboutBlank("https://wikipedia.org");

                

reset()

Resets the cloak to the default document title.

Example:


cloak.reset();