Skip to content

Instantly share code, notes, and snippets.

View Godofbrowser's full-sized avatar
🔥
Setting browsers on fire!!!

Emeke Ajeh Godofbrowser

🔥
Setting browsers on fire!!!
View GitHub Profile
@tannerlinsley
tannerlinsley / onWindowFocus.ts
Last active September 22, 2025 09:13
A utility function to detect window focusing without false positives from iframe focus events
type State = {
added: boolean;
interval: false | ReturnType<typeof setInterval>;
inFrame: boolean;
callbacks: Array<SetFocusedCallback>;
};
type EnrichedHTMLIFrameElement = HTMLIFrameElement & { ___onWindowFocusHandled: boolean };
type SetFocusedCallback = (focused?: boolean) => void;
@hoshiyosan
hoshiyosan / Create a Vue.js plugin using Typescript.md
Last active July 22, 2024 00:43
Create a Vue.js plugin using Typescript

Create a Vue.js plugin using Typescript

Initialize project with npm

Create the project directory and initialize an npm project

mkdir my-plugin && cd my-plugin
npm init -y