diff --git a/moz.xpi b/moz.xpi index 0ff9b1f..e1e912d 100644 Binary files a/moz.xpi and b/moz.xpi differ diff --git a/moz.zip b/moz.zip index 8fab0ac..5a93508 100644 Binary files a/moz.zip and b/moz.zip differ diff --git a/moz/manifest.json b/moz/manifest.json index c5a61c9..49119c7 100644 --- a/moz/manifest.json +++ b/moz/manifest.json @@ -4,7 +4,7 @@ "homepage_url": "https://webtoplex.github.io/", "manifest_version": 2, - "version": "4.1.2.1", + "version": "4.1.2.2", "browser_specific_settings": { "gecko": { "id": "mink.cbos@gmail.com", diff --git a/moz/plex.js b/moz/plex.js index de3de74..04f5497 100644 --- a/moz/plex.js +++ b/moz/plex.js @@ -1,5 +1,5 @@ let script = { - "url": "*://app.plex.tv/desktop#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", + "url": "*://app.plex.tv/desktop/?#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", "ready": () => $('.loading').empty, diff --git a/moz/utils.js b/moz/utils.js index 7e418ec..f76e7c7 100644 --- a/moz/utils.js +++ b/moz/utils.js @@ -1003,7 +1003,7 @@ var INITIALIZE = INITIALIZE || (async date => { }); // the message has only 30s to "live" - setTimeout(() => Update.messages.splice(0, 1), 30000); + setTimeout(() => (Update.messages || []).splice(0, 1), 30000); if(postToo) top.postMessage(options); @@ -2643,10 +2643,15 @@ var INITIALIZE = INITIALIZE || (async date => { onmouseup: event => { let self = event.target, parent = button; - if(init instanceof Function) - button.setAttribute('class', 'closed floating web-to-plex-button restarting'), button.onmouseenter = button.onmouseleave = null, button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'), setTimeout(() => (init && !RUNNING? (init(), RUNNING = true): RUNNING = false), 500); - else + if(init instanceof Function) { + button.setAttribute('class', 'closed floating web-to-plex-button restarting'); + button.onmouseenter = button.onmouseleave = null; + button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'); + INITIALIZE(new Date); + init(); + } else { new Notification('warning', "Couldn't reload. Please refresh the page."); + } } }, furnish('i[orange][gradient=lighten]', { glyph: 'restart 3x', onmouseup: event => event.target.parentElement.click() }) // @@ -3207,6 +3212,7 @@ var INITIALIZE = INITIALIZE || (async date => { UTILS_TERMINAL.LOG('Told to reinitialize...'); document.queryBy('.web-to-plex-button').map(e => e.remove()); INITIALIZE(new Date); + init && init(); return true; case 'NO_RENDER': diff --git a/opa.crx b/opa.crx index bee20e6..84ff68f 100644 Binary files a/opa.crx and b/opa.crx differ diff --git a/opa.zip b/opa.zip index 064bf6b..5a1aae9 100644 Binary files a/opa.zip and b/opa.zip differ diff --git a/opa/manifest.json b/opa/manifest.json index c2ccf01..48d5ebf 100644 --- a/opa/manifest.json +++ b/opa/manifest.json @@ -4,7 +4,7 @@ "homepage_url": "https://webtoplex.github.io/", "manifest_version": 2, - "version": "4.1.2.1", + "version": "4.1.2.2", "icons": { "16": "16.png", diff --git a/opa/plex.js b/opa/plex.js index de3de74..04f5497 100644 --- a/opa/plex.js +++ b/opa/plex.js @@ -1,5 +1,5 @@ let script = { - "url": "*://app.plex.tv/desktop#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", + "url": "*://app.plex.tv/desktop/?#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", "ready": () => $('.loading').empty, diff --git a/opa/plugn.js b/opa/plugn.js index d1aef56..79b09b5 100644 --- a/opa/plugn.js +++ b/opa/plugn.js @@ -665,7 +665,7 @@ chrome.runtime.onMessage.addListener(processMessage = async(request = {}, sender await fetch(style, { mode: 'cors' }) .then(response => response.text()) - .then(async code => browser.tabs.insertCSS({ code })); + .then(async code => chrome.tabs.insertCSS({ code })); return true; } catch(error) { diff --git a/opa/utils.js b/opa/utils.js index 1a19cec..781a873 100644 --- a/opa/utils.js +++ b/opa/utils.js @@ -1035,7 +1035,7 @@ let INITIALIZE = (async date => { }); // the message has only 30s to "live" - setTimeout(() => Update.messages.splice(0, 1), 30000); + setTimeout(() => (Update.messages || []).splice(0, 1), 30000); if(postToo) top.postMessage(options); @@ -2640,10 +2640,15 @@ let INITIALIZE = (async date => { onmouseup: event => { let self = event.target, parent = button; - if(init instanceof Function) - button.setAttribute('class', 'closed floating web-to-plex-button restarting'), button.onmouseenter = button.onmouseleave = null, button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'), setTimeout(() => (init && !RUNNING? (init(), RUNNING = true): RUNNING = false), 500); - else + if(init instanceof Function) { + button.setAttribute('class', 'closed floating web-to-plex-button restarting'); + button.onmouseenter = button.onmouseleave = null; + button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'); + INITIALIZE(new Date); + init(); + } else { new Notification('warning', "Couldn't reload. Please refresh the page."); + } } }, furnish('i[orange][gradient=lighten]', { glyph: 'restart 3x', onmouseup: event => event.target.parentElement.click() }) // @@ -3238,6 +3243,7 @@ let INITIALIZE = (async date => { UTILS_TERMINAL.LOG('Told to reinitialize...'); document.queryBy('.web-to-plex-button').map(e => e.remove()); INITIALIZE(new Date); + init && init(); return true; case 'NO_RENDER': diff --git a/src.crx b/src.crx index f25a205..d4e7f14 100644 Binary files a/src.crx and b/src.crx differ diff --git a/src.zip b/src.zip index 8f5e5cc..091b0da 100644 Binary files a/src.zip and b/src.zip differ diff --git a/src/cloud/plex.js b/src/cloud/plex.js index de3de74..04f5497 100644 --- a/src/cloud/plex.js +++ b/src/cloud/plex.js @@ -1,5 +1,5 @@ let script = { - "url": "*://app.plex.tv/desktop#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", + "url": "*://app.plex.tv/desktop/?#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", "ready": () => $('.loading').empty, diff --git a/src/manifest.json b/src/manifest.json index 7d4cf90..9ecd9e4 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -4,7 +4,7 @@ "homepage_url": "https://webtoplex.github.io/", "manifest_version": 2, - "version": "4.1.2.1", + "version": "4.1.2.2", "icons": { "16": "img/16.png", diff --git a/src/plugn.js b/src/plugn.js index 70062b9..ff1ff5f 100644 --- a/src/plugn.js +++ b/src/plugn.js @@ -665,7 +665,7 @@ chrome.runtime.onMessage.addListener(processMessage = async(request = {}, sender await fetch(style, { mode: 'cors' }) .then(response => response.text()) - .then(async code => browser.tabs.insertCSS({ code })); + .then(async code => chrome.tabs.insertCSS({ code })); return true; } catch(error) { diff --git a/src/utils.js b/src/utils.js index 631642c..b9422c0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1035,7 +1035,7 @@ let INITIALIZE = (async date => { }); // the message has only 30s to "live" - setTimeout(() => Update.messages.splice(0, 1), 30000); + setTimeout(() => (Update.messages || []).splice(0, 1), 30000); if(postToo) top.postMessage(options); @@ -2640,10 +2640,15 @@ let INITIALIZE = (async date => { onmouseup: event => { let self = event.target, parent = button; - if(init instanceof Function) - button.setAttribute('class', 'closed floating web-to-plex-button restarting'), button.onmouseenter = button.onmouseleave = null, button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'), setTimeout(() => (init && !RUNNING? (init(), RUNNING = true): RUNNING = false), 500); - else + if(init instanceof Function) { + button.setAttribute('class', 'closed floating web-to-plex-button restarting'); + button.onmouseenter = button.onmouseleave = null; + button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'); + INITIALIZE(new Date); + init(); + } else { new Notification('warning', "Couldn't reload. Please refresh the page."); + } } }, furnish('i[orange][gradient=lighten]', { glyph: 'restart 3x', onmouseup: event => event.target.parentElement.click() }) // @@ -3238,6 +3243,7 @@ let INITIALIZE = (async date => { UTILS_TERMINAL.LOG('Told to reinitialize...'); document.queryBy('.web-to-plex-button').map(e => e.remove()); INITIALIZE(new Date); + init && init(); return true; case 'NO_RENDER': diff --git a/win.crx b/win.crx index 4ab80de..2056d31 100644 Binary files a/win.crx and b/win.crx differ diff --git a/win.zip b/win.zip index ee476d2..2138cc9 100644 Binary files a/win.zip and b/win.zip differ diff --git a/win/cloud/plex.js b/win/cloud/plex.js index de3de74..04f5497 100644 --- a/win/cloud/plex.js +++ b/win/cloud/plex.js @@ -1,5 +1,5 @@ let script = { - "url": "*://app.plex.tv/desktop#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", + "url": "*://app.plex.tv/desktop/?#!/(server/(?:[a-f\\d]+)|provider/(?:tv.plex.provider.vod))/(details|list)\\?*", "ready": () => $('.loading').empty, diff --git a/win/manifest.json b/win/manifest.json index 7d4cf90..9ecd9e4 100644 --- a/win/manifest.json +++ b/win/manifest.json @@ -4,7 +4,7 @@ "homepage_url": "https://webtoplex.github.io/", "manifest_version": 2, - "version": "4.1.2.1", + "version": "4.1.2.2", "icons": { "16": "img/16.png", diff --git a/win/plugn.js b/win/plugn.js index 70062b9..ff1ff5f 100644 --- a/win/plugn.js +++ b/win/plugn.js @@ -665,7 +665,7 @@ chrome.runtime.onMessage.addListener(processMessage = async(request = {}, sender await fetch(style, { mode: 'cors' }) .then(response => response.text()) - .then(async code => browser.tabs.insertCSS({ code })); + .then(async code => chrome.tabs.insertCSS({ code })); return true; } catch(error) { diff --git a/win/utils.js b/win/utils.js index 4f2f878..e3b4446 100644 --- a/win/utils.js +++ b/win/utils.js @@ -1035,7 +1035,7 @@ let INITIALIZE = (async date => { }); // the message has only 30s to "live" - setTimeout(() => Update.messages.splice(0, 1), 30000); + setTimeout(() => (Update.messages || []).splice(0, 1), 30000); if(postToo) top.postMessage(options); @@ -2640,10 +2640,15 @@ let INITIALIZE = (async date => { onmouseup: event => { let self = event.target, parent = button; - if(init instanceof Function) - button.setAttribute('class', 'closed floating web-to-plex-button restarting'), button.onmouseenter = button.onmouseleave = null, button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'), setTimeout(() => (init && !RUNNING? (init(), RUNNING = true): RUNNING = false), 500); - else + if(init instanceof Function) { + button.setAttribute('class', 'closed floating web-to-plex-button restarting'); + button.onmouseenter = button.onmouseleave = null; + button.querySelector('.list-action').setAttribute('tooltip', 'Restarting...'); + INITIALIZE(new Date); + init(); + } else { new Notification('warning', "Couldn't reload. Please refresh the page."); + } } }, furnish('i[orange][gradient=lighten]', { glyph: 'restart 3x', onmouseup: event => event.target.parentElement.click() }) // @@ -3238,6 +3243,7 @@ let INITIALIZE = (async date => { UTILS_TERMINAL.LOG('Told to reinitialize...'); document.queryBy('.web-to-plex-button').map(e => e.remove()); INITIALIZE(new Date); + init && init(); return true; case 'NO_RENDER':