summaryrefslogtreecommitdiffstats
path: root/mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js
diff options
context:
space:
mode:
Diffstat (limited to 'mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js')
-rw-r--r--mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js48
1 files changed, 25 insertions, 23 deletions
diff --git a/mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js b/mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js
index f4af7d3b0d..f1fcd6d241 100644
--- a/mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js
+++ b/mobile/android/fenix/app/src/main/assets/highRiskErrorPages.js
@@ -6,37 +6,39 @@
* Handles the parsing of the ErrorPages URI and then passes them to injectValues
*/
function parseQuery(queryString) {
- if (queryString[0] === '?') {
- queryString = queryString.substr(1);
- }
- const query = Object.fromEntries(new URLSearchParams(queryString).entries());
- injectValues(query);
-};
+ if (queryString[0] === "?") {
+ queryString = queryString.substr(1);
+ }
+ const query = Object.fromEntries(new URLSearchParams(queryString).entries());
+ injectValues(query);
+}
/**
* Updates the HTML elements based on the queryMap
*/
function injectValues(queryMap) {
- // Go through each element and inject the values
- document.title = queryMap.title;
- document.getElementById('errorTitleText').innerHTML = queryMap.title;
- document.getElementById('errorShortDesc').innerHTML = queryMap.description;
+ // Go through each element and inject the values
+ document.title = queryMap.title;
+ document.getElementById("errorTitleText").innerHTML = queryMap.title;
+ document.getElementById("errorShortDesc").innerHTML = queryMap.description;
- // If no image is passed in, remove the element so as not to leave an empty iframe
- const errorImage = document.getElementById('errorImage');
- if (!queryMap.image) {
- errorImage.remove();
- } else {
- errorImage.src = "resource://android/assets/" + queryMap.image;
- }
+ // If no image is passed in, remove the element so as not to leave an empty iframe
+ const errorImage = document.getElementById("errorImage");
+ if (!queryMap.image) {
+ errorImage.remove();
+ } else {
+ errorImage.src = "resource://android/assets/" + queryMap.image;
+ }
}
-document.addEventListener('DOMContentLoaded', function () {
- if (window.history.length == 1) {
- document.getElementById('backButton').style.display = 'none';
- } else {
- document.getElementById('backButton').addEventListener('click', () => window.history.back() );
- }
+document.addEventListener("DOMContentLoaded", function () {
+ if (window.history.length == 1) {
+ document.getElementById("backButton").style.display = "none";
+ } else {
+ document
+ .getElementById("backButton")
+ .addEventListener("click", () => window.history.back());
+ }
});
parseQuery(document.documentURI);