-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 156 obsolete browsers #159
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable @blueprintjs/classes-constants -- do not import files */ | ||
const dataset = | ||
typeof document !== "undefined" && | ||
document.querySelector("#obsolete-browsers").dataset; | ||
|
||
const datasetRegex = dataset.regex; | ||
|
||
const regex = new RegExp(datasetRegex.slice(1, -1)); | ||
|
||
if (dataset && !regex.test(navigator.userAgent)) { | ||
const root = document.getElementById("root"); | ||
root.remove(); | ||
const portals = document.getElementsByClassName("bp3-portal"); | ||
for (let i = 0; i < portals.length; i += 1) { | ||
portals[i].remove(); | ||
} | ||
|
||
const element = document.createElement("div"); | ||
element.innerHTML = dataset.template; | ||
document.body.appendChild(element); | ||
} | ||
/* eslint-enable @blueprintjs/classes-constants -- do not import files */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
<script> | ||
/** Reflect ANY changes to this script in the script hash in `server/eb/app.py` **/ | ||
var root = document.getElementById("root"); | ||
root.remove(); | ||
var portals = document.getElementsByClassName("bp3-portal"); | ||
for (var i = 0; i < portals.length; i += 1) { | ||
portals[i].remove(); | ||
} | ||
</script> | ||
Comment on lines
-1
to
-9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're going to need to update CSP There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah thank you! Yeah we can remove the associated hash now! I'll add it as a TODO in the PR and ticket descriptions 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OH! It's just in the BE code not in Infra repo lol Updated! Thank you! |
||
<div | ||
style=" | ||
display: flex; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,12 @@ | |
> | ||
|
||
<div id="root"></div> | ||
<script | ||
async | ||
src="static/obsoleteBrowsers.js" | ||
id="obsolete-browsers" | ||
data-template="<%= OBSOLETE_TEMPLATE %>" | ||
data-regex="<%= OBSOLETE_REGEX %>" | ||
></script> | ||
Comment on lines
+45
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this going to need to be reflected in CSP? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great question! Since the script will be served from the same domain as the HTML page, |
||
</body> | ||
</html> |
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.
Maybe this too will need to be included in CSP?
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.
Please see comment above!