Skip to content

Commit

Permalink
Only attempt to change user agent if it is provided as an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahaog committed Jan 19, 2016
1 parent 5adf7b9 commit 53383eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ ipc.on('params', function(event, message) {
webView.setAttribute('minwidth', '100');
webView.setAttribute('minheight', '100');

webView.addEventListener('did-start-loading', function() {
webView.setUserAgent(appArgs.userAgent);
});
if (appArgs.userAgent) {
webView.addEventListener('did-start-loading', function() {
webView.setUserAgent(appArgs.userAgent);
});
}

webView.addEventListener('new-window', function(e) {
require('shell').openExternal(e.url);
Expand Down

0 comments on commit 53383eb

Please sign in to comment.