Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ function launch(launchData) {
chrome.storage.local.remove('relativeLaunchUrl', launchApp);
}

// If we are relaunching the app, inform the webview so it'll start again.
if(window.app && relativeUrl) {
chrome.runtime.sendMessage({command: "restart"}, (response) => {});
}

function launchApp() {
var info = {
type: 'onLaunched',
Expand Down
8 changes: 7 additions & 1 deletion browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ function handleLoadRedirect(event) {
return;
}

document.querySelector('#location').value = event.newUrl;
var location = document.querySelector('#location');
if(location !== null){
location.value = event.newUrl;
}
}

function handleNewWindow(event) {
Expand Down Expand Up @@ -272,7 +275,10 @@ function handleMessage(message, sender, sendResponse) {
});
});
return !!sendResponse; // wait for response
} else if (message.command === 'restart') {
onload();
}
}

chrome.runtime.onMessageExternal.addListener(handleMessage);
chrome.runtime.onMessage.addListener(handleMessage);
10 changes: 1 addition & 9 deletions parseSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@ function convertServerSettingsToUrl(serverSettings, launchUrl) {
queryString.push('env=' + serverSettings.env);
}
}

//if no environment set then default to production
var envIndex = queryString.findIndex(function(item) {
return /^env=/.test(item);
});
if (envIndex < 0) {
queryString.push('env=production');
}
queryString.push('platform=chromeApp');

url += (url.indexOf('?') < 0 ? '?' : '&') + queryString.join('&');

return url;
}