Skip to content

Instantly share code, notes, and snippets.

@samternent
Created August 17, 2020 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samternent/8fc20c10aacb5ac5559deb8928b1d3e3 to your computer and use it in GitHub Desktop.
Save samternent/8fc20c10aacb5ac5559deb8928b1d3e3 to your computer and use it in GitHub Desktop.
export async function globalScope() {
lazyLoadCss();
Object.assign(window, {
loadStartTime: new Date(),
initialData: window.initialData !== '[CF:initialData]'
? window.initialData
: {
'v/1/settings/branding.json': {
branding: {
theme: {
color: '#ff00cc',
},
},
},
'account.json': {},
},
defaultFilters: window.defaultFilters !== '[CF:defaultFilters]'
? window.defaultFilters
: {},
validFilters: window.validFilters !== '[CF:validFilters]'
? window.validFilters
: {},
// This needs to be stripped out ASAP
// It is a temporary fix for a bug caused by LastPass
XMLHttpRequestSend: typeof XMLHttpRequest !== 'undefined' && XMLHttpRequest.prototype && XMLHttpRequest.prototype.send,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment