FIX: Make embeddable discourse more forgiving with https
This commit is contained in:
parent
905068cf23
commit
7a01d575c2
|
@ -63,9 +63,13 @@
|
||||||
return top;
|
return top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function normalizeUrl(url) {
|
||||||
|
return url.replace(/^https?(\:\/\/)?/, '');
|
||||||
|
}
|
||||||
|
|
||||||
function postMessageReceived(e) {
|
function postMessageReceived(e) {
|
||||||
if (!e) { return; }
|
if (!e) { return; }
|
||||||
if (DE.discourseUrl.indexOf(e.origin) === -1) { return; }
|
if (normalizeUrl(DE.discourseUrl).indexOf(normalizeUrl(e.origin)) === -1) { return; }
|
||||||
|
|
||||||
if (e.data) {
|
if (e.data) {
|
||||||
if (e.data.type === 'discourse-resize' && e.data.height) {
|
if (e.data.type === 'discourse-resize' && e.data.height) {
|
||||||
|
|
Loading…
Reference in New Issue