mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-14 19:29:50 +00:00
fix generate from/add as chapter an empty selection
This commit is contained in:
parent
2b5ebdef92
commit
06027ea882
2 changed files with 9 additions and 0 deletions
|
@ -297,6 +297,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmpContent.trim() === '') {
|
if (tmpContent.trim() === '') {
|
||||||
|
sendResponse('');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,14 @@ function sendMessage(tabId, action, justAddToBuffer) {
|
||||||
chrome.tabs.sendMessage(tabId, {
|
chrome.tabs.sendMessage(tabId, {
|
||||||
type: action
|
type: action
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
|
if (response.length === 0) {
|
||||||
|
if (justAddToBuffer) {
|
||||||
|
alert('Cannot add an empty selection as chapter!');
|
||||||
|
} else {
|
||||||
|
alert('Cannot generate the eBook from an empty selection!');
|
||||||
|
}
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
if (!justAddToBuffer) {
|
if (!justAddToBuffer) {
|
||||||
buildEbook([response]);
|
buildEbook([response]);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue