diff --git a/index.json b/index.json index f167f7a..e96186c 100644 --- a/index.json +++ b/index.json @@ -27,7 +27,7 @@ "name": "nhentai", "fileName": "nhentai.js", "key": "nhentai", - "version": "1.0.4" + "version": "1.0.5" }, { "name": "紳士漫畫", diff --git a/nhentai.js b/nhentai.js index b1c106c..f029b24 100644 --- a/nhentai.js +++ b/nhentai.js @@ -7,7 +7,7 @@ class Nhentai extends ComicSource { // unique id of the source key = "nhentai" - version = "1.0.4" + version = "1.0.5" minAppVersion = "1.0.0" @@ -328,6 +328,25 @@ class Nhentai extends ComicSource { /// single comic related comic = { + /** + * [Optional] provide configs for a thumbnail loading + * @param url {string} + * @returns {ImageLoadingConfig | Promise} + * + * `ImageLoadingConfig.modifyImage` and `ImageLoadingConfig.onLoadFailed` will be ignored. + * They are not supported for thumbnails. + */ + onThumbnailLoad: (url) => { + if(url.startsWith("//")) { + url = "https:" + url + } else if(!url.startsWith("http")) { + url = "https://" + url + } + + return { + url: url, + } + }, /** * load comic info * @param id {string}