diff --git a/src/scripts/content_script.js b/src/scripts/content_script.js index ee262fd..286eb46 100644 --- a/src/scripts/content_script.js +++ b/src/scripts/content_script.js @@ -50,7 +50,7 @@ from: 'BLOCKTUBE_CONTENT', type: 'storageData', data: compiledStorage || globalStorage, - }, `https://${document.domain}`); + }, document.location.origin); }, inject() { const s = document.createElement('script'); diff --git a/src/scripts/inject.js b/src/scripts/inject.js index 659a5ac..4392938 100644 --- a/src/scripts/inject.js +++ b/src/scripts/inject.js @@ -464,7 +464,7 @@ // !! Utils function postMessage(type, data) { - window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, `https://${document.domain}`); + window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, document.locaion.origin); } function getObjectByPath(obj, path, def = undefined) { diff --git a/src/scripts/seed.js b/src/scripts/seed.js index 24473c2..9ca5dc1 100644 --- a/src/scripts/seed.js +++ b/src/scripts/seed.js @@ -116,7 +116,7 @@ } function postMessage(type, data) { - window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, `https://${document.domain}`); + window.postMessage({ from: 'BLOCKTUBE_PAGE', type, data }, document.location.origin); } if (window.writeEmbed || window.ytplayer || window.Polymer) {