Delay loading of non-essential css/js
This commit is contained in:
parent
ed07cb8460
commit
5c38441393
24
manage.html
24
manage.html
|
@ -6,10 +6,10 @@
|
|||
<title i18n-text="manageTitle"></title>
|
||||
<link rel="stylesheet" href="global.css">
|
||||
<link rel="stylesheet" href="manage/manage.css">
|
||||
<link rel="stylesheet" href="manage/config-dialog.css">
|
||||
<link rel="stylesheet" href="msgbox/msgbox.css">
|
||||
<link rel="stylesheet" href="options/onoffswitch.css">
|
||||
<link rel="stylesheet" href="vendor-overwrites/colorpicker/colorpicker.css">
|
||||
<link rel="stylesheet" data-href="manage/config-dialog.css">
|
||||
<link rel="stylesheet" data-href="msgbox/msgbox.css">
|
||||
<link rel="stylesheet" data-href="options/onoffswitch.css">
|
||||
<link rel="stylesheet" data-href="vendor-overwrites/colorpicker/colorpicker.css">
|
||||
|
||||
<style id="firefox-transitions-bug-suppressor">
|
||||
/* restrict to FF */
|
||||
|
@ -193,16 +193,16 @@
|
|||
<script src="manage/sort.js"></script>
|
||||
<script src="manage/manage-ui.js"></script>
|
||||
<script src="manage/manage-actions.js"></script>
|
||||
<script src="manage/draggable.js"></script>
|
||||
<script data-src="manage/draggable.js"></script>
|
||||
|
||||
<script src="vendor-overwrites/colorpicker/colorconverter.js"></script>
|
||||
<script src="vendor-overwrites/colorpicker/colorpicker.js"></script>
|
||||
<script src="manage/config-dialog.js"></script>
|
||||
<script data-src="vendor-overwrites/colorpicker/colorconverter.js"></script>
|
||||
<script data-src="vendor-overwrites/colorpicker/colorpicker.js"></script>
|
||||
<script data-src="manage/config-dialog.js"></script>
|
||||
<script src="manage/updater-ui.js"></script>
|
||||
<script src="manage/object-diff.js"></script>
|
||||
<script src="manage/import-export.js"></script>
|
||||
<script src="manage/incremental-search.js"></script>
|
||||
<script src="msgbox/msgbox.js"></script>
|
||||
<script data-src="manage/object-diff.js"></script>
|
||||
<script data-src="manage/import-export.js"></script>
|
||||
<script data-src="manage/incremental-search.js"></script>
|
||||
<script data-src="msgbox/msgbox.js"></script>
|
||||
<script src="js/sections-util.js"></script>
|
||||
<script src="js/storage-util.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -33,6 +33,7 @@ Promise.all([
|
|||
]).then(args => {
|
||||
UI.init();
|
||||
UI.showStyles(...args);
|
||||
lazyLoad();
|
||||
});
|
||||
|
||||
msg.onExtension(onRuntimeMessage);
|
||||
|
@ -407,3 +408,16 @@ function onVisibilityChange() {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function lazyLoad() {
|
||||
setTimeout(() => {
|
||||
$$('link[data-href]').forEach(link => {
|
||||
link.href = link.dataset.href;
|
||||
link.removeAttribute('data-href');
|
||||
});
|
||||
$$('script[data-src]').forEach(script => {
|
||||
script.src = script.dataset.src;
|
||||
script.removeAttribute('data-src');
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user