Skip to content

Commit c3140a1

Browse files
author
arne
committed
chore: replace $(document).ready(...) with document.addEventListener('DOMContentLoaded', ...)
1 parent 55e3913 commit c3140a1

18 files changed

Lines changed: 18 additions & 18 deletions

bandcamp_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ const collectDiscographyReleaseLinks = ({ linksMatcher, hostname, insertionLocat
355355
return urls_data;
356356
};
357357

358-
$(document).ready(function () {
358+
document.addEventListener('DOMContentLoaded', () => {
359359
/* keep the following line as first, it is required to skip
360360
* pages which aren't actually a bandcamp page, since we support
361361
* bandcamp pages under third-party domains.

cd1d_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const CD1DImporter = {
260260
},
261261
};
262262

263-
$(document).ready(function () {
263+
document.addEventListener('DOMContentLoaded', () => {
264264
MBImportStyle();
265265
/* CD1D uses same page with hidden tabs for all formats */
266266
let formats = CD1DImporter.getFormats();

deezer_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// prevent JQuery conflicts, see http://wiki.greasespot.net/@grant
1919
this.$ = this.jQuery = jQuery.noConflict(true);
2020

21-
$(document).ready(function () {
21+
document.addEventListener('DOMContentLoaded', () => {
2222
let gmXHR;
2323

2424
if (typeof GM_xmlhttpRequest != 'undefined') {

discogs_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (DEBUG) {
3535

3636
const mbLinks = new MBLinks('DISCOGS_MBLINKS_CACHE', '1');
3737

38-
$(document).ready(function () {
38+
document.addEventListener('DOMContentLoaded', () => {
3939
MBImportStyle();
4040
MBSearchItStyle();
4141

encyclopedisque_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
const mbLinks = new MBLinks('ENCYLOPEDISQUE_MBLINKS_CACHE');
1919

20-
$(document).ready(function () {
20+
document.addEventListener('DOMContentLoaded', () => {
2121
MBImportStyle();
2222

2323
if (window.location.href.match(/encyclopedisque\.fr\/disque\/(\d+)/)) {

fma_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const release_attributes = {}; // albumid, total_pages, artist_name, label
4848
const album_api_array = []; // album information [0]
4949
const tracks_api_array = []; // track information [0,1,2,..] one element for each pagination in FMA tracks API
5050

51-
$(document).ready(function () {
51+
document.addEventListener('DOMContentLoaded', () => {
5252
// if we have something on local storage place that
5353
if (localStorage.getItem('FMA_API_KEY')) {
5454
FMA_API = localStorage.getItem('FMA_API_KEY'); // -> YOURAPIKEY

hdtracks_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// prevent JQuery conflicts, see http://wiki.greasespot.net/@grant
1919
this.$ = this.jQuery = jQuery.noConflict(true);
2020

21-
$(document).ready(function () {
21+
document.addEventListener('DOMContentLoaded', () => {
2222
MBImportStyle();
2323
window.addEventListener('hashchange', parsePage); // HDtracks is a single page app (SPA)
2424
});

juno_download_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// prevent JQuery conflicts, see http://wiki.greasespot.net/@grant
1818
this.$ = this.jQuery = jQuery.noConflict(true);
1919

20-
$(document).ready(function () {
20+
document.addEventListener('DOMContentLoaded', () => {
2121
MBImportStyle();
2222
let releaseUrl = window.location.href.replace('/?.*$/', '').replace(/#.*$/, '');
2323
let release = retrieveReleaseInfo(releaseUrl);

lib/mblinks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The main method is searchAndDisplayMbLink()
33

44
// Example:
5-
// $(document).ready(function () {
5+
// document.addEventListener('DOMContentLoaded', () => {
66
//
77
// var mblinks = new MBLinks('EXAMPLE_MBLINKS_CACHE', 7*24*60); // force refresh of cached links once a week
88
//

loot_importer.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if (DEBUG) {
3434
* - http://www.loot.co.za/product/bette-midler-a-gift-of-love/mhgm-3483-g060 *** NOT WORKING *** extra tab
3535
*/
3636

37-
$(document).ready(function () {
37+
document.addEventListener('DOMContentLoaded', () => {
3838
LOGGER.info('Document Ready & Loot Userscript executing');
3939
let LootRelease = ParseLootPage();
4040
insertMBSection(LootRelease);

0 commit comments

Comments
 (0)