diff options
author | 2019-09-28 12:10:25 +0200 | |
---|---|---|
committer | 2019-09-28 12:10:25 +0200 | |
commit | 728d339739b63e9bb59e457e4a84fe9a65b93fc9 (patch) | |
tree | a0fc6180ea26fa9ef397458e8eb6491031d6437d /uncompressed/franz-custom-website/index.js | |
parent | Add list of recipes (diff) | |
download | ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.gz ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.tar.zst ferdium-recipes-728d339739b63e9bb59e457e4a84fe9a65b93fc9.zip |
Add uncompressed recipes
Diffstat (limited to 'uncompressed/franz-custom-website/index.js')
-rw-r--r-- | uncompressed/franz-custom-website/index.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/uncompressed/franz-custom-website/index.js b/uncompressed/franz-custom-website/index.js new file mode 100644 index 0000000..47da782 --- /dev/null +++ b/uncompressed/franz-custom-website/index.js | |||
@@ -0,0 +1,20 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Franz => class CustomWebsite extends Franz { | ||
4 | async validateUrl(url) { | ||
5 | try { | ||
6 | const resp = await window.fetch(url, { | ||
7 | method: 'GET', | ||
8 | headers: { | ||
9 | 'Content-Type': 'application/json' | ||
10 | } | ||
11 | }); | ||
12 | return resp.status.toString().startsWith('2') || resp.status.toString().startsWith('3'); | ||
13 | } catch (err) { | ||
14 | console.error(err); | ||
15 | } | ||
16 | |||
17 | return false; | ||
18 | } | ||
19 | |||
20 | }; \ No newline at end of file | ||