Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
closes /creating tab if upload fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nihakhanna committed Mar 22, 2017
1 parent 098678f commit e812186
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions addon/webextension/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ window.main = (function () {
title: browser.i18n.getMessage("notificationLinkCopiedTitle"),
message: browser.i18n.getMessage("notificationLinkCopiedDetails", pasteSymbol)
});
} else {
catcher.watchPromise(browser.tabs.query({active: true, currentWindow: true})
.then((tabs) => {
for (let tab of tabs) {
if(tab.url.match(/\/creating/i)) {
catcher.watchPromise(browser.tabs.remove(tab.id));
}
}
}));
}
});

Expand Down
1 change: 1 addition & 0 deletions addon/webextension/manifest.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"icons/download.svg"
],
"permissions": [
"tabs",
"activeTab",
"storage",
"notifications",
Expand Down

0 comments on commit e812186

Please sign in to comment.