support for headless browser & changes on book api
This commit is contained in:
@@ -130,7 +130,7 @@ async function loadChapters(idForFetch) {
|
||||
try {
|
||||
|
||||
const fetchUrl = extensionName
|
||||
? `/api/book/${idForFetch}/chapters`
|
||||
? `/api/book/${idForFetch}/chapters?ext=${extensionName}`
|
||||
: `/api/book/${idForFetch}/chapters`;
|
||||
|
||||
const res = await fetch(fetchUrl);
|
||||
@@ -174,7 +174,7 @@ function populateProviderFilter() {
|
||||
if (providers.length > 0) {
|
||||
select.style.display = 'inline-block';
|
||||
|
||||
select.innerHTML = '<option value="all">All Providers</option>';
|
||||
select.innerHTML = '';
|
||||
|
||||
providers.forEach(prov => {
|
||||
const opt = document.createElement('option');
|
||||
@@ -276,7 +276,9 @@ function updatePagination() {
|
||||
function openReader(bookId, chapterId, provider) {
|
||||
const c = encodeURIComponent(chapterId);
|
||||
const p = encodeURIComponent(provider);
|
||||
window.location.href = `/read/${p}/${c}/${bookId}`;
|
||||
let extension = "";
|
||||
if (extensionName) extension = "?" + extensionName;
|
||||
window.location.href = `/read/${p}/${c}/${bookId}${extension}`;
|
||||
}
|
||||
|
||||
init();
|
||||
Reference in New Issue
Block a user