Skip to content

Commit

Permalink
+ Error message for bad URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DieserMerlin committed Sep 10, 2020
1 parent 0c19137 commit 125c73a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ chrome.tabs.query({"active": true, "lastFocusedWindow": true}, async tabs => {
load(false);
copy();
} catch (e) {
error("Unable to create shortlink.");
if(!(url.toLowerCase().startsWith('http://') || url.toLowerCase().startsWith('https://')))
error('The current tab doesn\'t have a valid URL to shorten.');
else
error("Unable to create shortlink.");
console.log(e);
}
});
1 change: 1 addition & 0 deletions ui/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#error {
color: red;
min-width: 300px;
}

body {
Expand Down

0 comments on commit 125c73a

Please sign in to comment.