Skip to content

Instantly share code, notes, and snippets.

moekhalil

Block or report user

Report or block moekhalil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@moekhalil
moekhalil / getSiteVars.js
Created Feb 25, 2019
Extract a websites custom global variables. Very not-tested.
View getSiteVars.js
const getSiteVars = () => {
const blankWindow = window.open('about:blank');
const defaultKeys = Object.keys(blankWindow);
blankWindow.close();
return Object
.keys(window)
.reduce((all, key) =>
blankWindow.hasOwnProperty(key) ? all : { ...all, [key]: window[key]}
, {}
);
You can’t perform that action at this time.