Browse Source

fix(alwaysontop): URLs for the additionally loaded resources.

master
hristoterezov 7 years ago
parent
commit
eb30ea9693
1 changed files with 14 additions and 2 deletions
  1. 14
    2
      modules/API/external/external_api.js

+ 14
- 2
modules/API/external/external_api.js View File

@@ -215,7 +215,6 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
215 215
             noSSL,
216 216
             roomName
217 217
         });
218
-        this._baseUrl = `${noSSL ? 'http' : 'https'}://${domain}/`;
219 218
         this._createIFrame(height, width);
220 219
         this._transport = new Transport({
221 220
             backend: new PostMessageTransportBackend({
@@ -261,8 +260,21 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
261 260
      * @returns {Array<string>}
262 261
      */
263 262
     _getAlwaysOnTopResources() {
263
+        const iframeWindow = this._frame.contentWindow;
264
+        const iframeDocument = iframeWindow.document;
265
+        let baseURL = '';
266
+        const base = iframeDocument.querySelector('base');
267
+
268
+        if (base && base.href) {
269
+            baseURL = base.href;
270
+        } else {
271
+            const { protocol, host } = iframeWindow.location;
272
+
273
+            baseURL = `${protocol}//${host}`;
274
+        }
275
+
264 276
         return ALWAYS_ON_TOP_FILENAMES.map(
265
-            filename => this._baseUrl + filename
277
+            filename => (new URL(filename, baseURL)).href
266 278
         );
267 279
     }
268 280
 

Loading…
Cancel
Save