Skip to content

Instantly share code, notes, and snippets.

View code-atom's full-sized avatar
🏠
Working from home

Ankit Rana code-atom

🏠
Working from home
View GitHub Profile
"use strict";
const { addObserver, notifyObservers } = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
const { getEnumerator } = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
const isBrowser = window => {
try {
return window.document.documentElement.getAttribute("windowtype") === "navigator:browser";