Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
Don't log (to console) errors that are already visible in the dialog.  Some formatting.

Refs greasemonkey#2092
  • Loading branch information
arantius committed Mar 13, 2018
1 parent 14aa984 commit b8eb199
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/content/install-dialog.js
Expand Up @@ -3,16 +3,22 @@ let gDetails = null;
let gInstallCountdown = 9;
let gProgressBar = document.querySelector('progress');
let gRvDetails = {
// Error message.
'errorHeader': '',
'errorList': [],

// Script details.
'excludes': [],
'grants': [],
'includes': [],
'iconUrl': defaultIconUrl,
'includes': [],
'matches': [],
};


rivets.bind(document.body, gRvDetails);


let gUserScriptUrl = unescape(document.location.search.substr(1));

let gDownloader = new UserScriptDownloader().setScriptUrl(gUserScriptUrl);
Expand All @@ -28,7 +34,6 @@ gDownloader.addProgressListener(() => {
gDownloader.scriptDetails.then(scriptDetails => {
gDetails = scriptDetails;

// TODO: Localize string.
document.title = _('NAME_greasemonkey_user_script', gDetails.name);
// Apply the onerror event for the img tag. CSP does not allow it to be done
// directly in HTML.
Expand All @@ -42,12 +47,6 @@ gDownloader.scriptDetails.then(scriptDetails => {
Object.assign(gRvDetails, rvDetails);

document.body.className = 'install';
}).catch(err => {
/* Any errors that should be shown to the user will be caught in the
* `start().catch()` promise chain.
*/
// Noop, but log the error
console.warn('installer could not get script details:', err);
});

/******************************* CANCEL BUTTON *******************************/
Expand Down

0 comments on commit b8eb199

Please sign in to comment.