mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-12 18:29:55 +00:00
miisc
This commit is contained in:
parent
aee4df3cc6
commit
14bdf5fec4
5 changed files with 39 additions and 53 deletions
|
@ -5,26 +5,6 @@ document.getElementById("editChapters").onclick = function() {
|
|||
win.focus();
|
||||
};
|
||||
|
||||
|
||||
function getEbookPages() { // TODO add as utils
|
||||
try {
|
||||
var allPages = localStorage.getItem('ebook');
|
||||
if (!allPages) {
|
||||
allPages = [];
|
||||
} else {
|
||||
allPages = JSON.parse(allPages);
|
||||
}
|
||||
return allPages;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function saveEbookPages(pages) {
|
||||
localStorage.setItem('ebook', JSON.stringify(pages));
|
||||
}
|
||||
|
||||
document.getElementById('savePage').onclick = function() {
|
||||
localStorage.removeItem('ebook');
|
||||
chrome.tabs.query({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue