"use strict"; let base_url = window.location.pathname.replace(/\/$/, ''); let config = { baseUrl: (window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + base_url, }; window.addEventListener("DOMContentLoaded", (event) => { let mopidy_link = document.createElement('a'); //mopidy_link.href = window.location.protocol + '//' + window.location.host + base_url + '/mobile/'; mopidy_link.href = window.location.protocol + '//' + window.location.hostname + ':6680/mobile/'; mopidy_link.target = '_blank'; mopidy_link.innerHTML = 'Mopidy'; document.getElementById('show').parentNode.appendChild(mopidy_link); });