Skip to content
This repository was archived by the owner on Aug 27, 2019. It is now read-only.

Commit 8361a4e

Browse files
committed
Defer all JavaScript
1 parent 37b9488 commit 8361a4e

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/options/options.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
/* global browser */
1919

2020
document.addEventListener("DOMContentLoaded", async () => {
21-
i18nInit();
22-
initOptions();
21+
return Promise.all([
22+
i18nInit(),
23+
initOptions()
24+
]);
2325
});
2426

2527
async function initOptions() {

src/options/options.xhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
2424
<link rel="stylesheet" type="text/css" href="options.css"/>
2525
<link rel="stylesheet" type="text/css" href="/browser-style-supplement/extension-options.css"/>
26-
<script type="application/javascript" src="/shared.js"/>
27-
<script type="application/javascript" src="options.js"/>
26+
<script type="application/javascript" defer="true" src="/shared.js"/>
27+
<script type="application/javascript" defer="true" src="options.js"/>
2828
</head>
2929
<body>
3030
<h1 class="browser-style" data-i18n="options_header"/>

src/popup/popup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ async function loadIcons() {
9292

9393
let hasSrcOS = false;
9494
try {
95-
hasSrcOS = (await fetch(srcOS)).ok; // Doesn’t work in 57
95+
hasSrcOS = (await fetch(srcOS)).ok; // Doesn’t work when loaded from file:// URLs
9696
} catch (err) {}
9797

9898
icon.addEventListener("error", err => {
9999
let i2 = document.createElement("img");
100100
i2.classList.add("icon", "eb-icon");
101-
// Fix for Firefox 57:
101+
// Fix for file:// URLs:
102102
if (hasSrcOS) {
103103
i2.setAttribute("src", src);
104104
i2.addEventListener("error", err => {

src/popup/popup.xhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
<title>Application Menu</title>
2323
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
2424
<link rel="stylesheet" type="text/css" href="popup.css"/>
25-
<script type="application/javascript" src="/shared.js"/>
26-
<script type="application/javascript" src="popup.js"/>
25+
<script type="application/javascript" defer="true" src="/shared.js"/>
26+
<script type="application/javascript" defer="true" src="popup.js"/>
2727
</head>
2828
<body>
2929
<main id="main" class="panel-section">

0 commit comments

Comments
 (0)