-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ export default memorizeResult(() => detectFocus({ | |
|
||
// writing the iframe's content is synchronous | ||
_document.open(); | ||
_document.write('<input>'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rodneyrehm
|
||
const input = _document.createElement('input'); | ||
_document.body.appendChild(input); | ||
_document.close(); | ||
|
||
return _document.querySelector('input'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
|
||
export default 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtb' | ||
This comment has been minimized.
Sorry, something went wrong.
ryan-ludwig
Author
|
||
+ 'G5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0ic3ZnIj48dGV4dCB4PSIxMCIgeT0iMjAiIGlkPSJ' | ||
+ 'zdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg=='; | ||
export default ''; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,39 +12,15 @@ function readLocalStorage(key) { | |
// allow reading from storage to retrieve previous support results | ||
// even while the document does not have focus | ||
let data; | ||
|
||
try { | ||
data = window.localStorage && window.localStorage.getItem(key); | ||
This comment has been minimized.
Sorry, something went wrong.
ryan-ludwig
Author
|
||
data = data ? JSON.parse(data) : {}; | ||
} catch (e) { | ||
data = {}; | ||
} | ||
|
||
data = {}; | ||
return data; | ||
} | ||
|
||
function writeLocalStorage(key, value) { | ||
if (!document.hasFocus()) { | ||
// if the document does not have focus when tests are executed, focus() may | ||
// not be handled properly and events may not be dispatched immediately. | ||
// This can happen when a document is reloaded while Developer Tools have focus. | ||
try { | ||
window.localStorage && window.localStorage.removeItem(key); | ||
} catch (e) { | ||
// ignore | ||
} | ||
|
||
return; | ||
} | ||
|
||
try { | ||
window.localStorage && window.localStorage.setItem(key, JSON.stringify(value)); | ||
} catch (e) { | ||
// ignore | ||
} | ||
return | ||
} | ||
|
||
const userAgent = typeof window !== 'undefined' && window.navigator.userAgent || ''; | ||
const userAgent = ''; | ||
const cacheKey = 'ally-supports-cache'; | ||
let cache = readLocalStorage(cacheKey); | ||
|
||
|
1 comment
on commit 7bf81c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain why these changes are necessary for "Chrome packaged apps"?
Throws a console error, "Uncaught document.write() is not available in packaged apps."