From 6f5e4a00588aefdda7a5a1cfe70935870e7e234a Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 22 Sep 2020 20:56:48 +0200 Subject: Unpack recipes and update recipes icons (#292) Co-authored-by: Amine Mouafik --- recipes/franz-custom-website/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 recipes/franz-custom-website/index.js (limited to 'recipes/franz-custom-website/index.js') diff --git a/recipes/franz-custom-website/index.js b/recipes/franz-custom-website/index.js new file mode 100644 index 0000000..62f4218 --- /dev/null +++ b/recipes/franz-custom-website/index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = Franz => class CustomWebsite extends Franz { + async validateUrl(url) { + try { + const resp = await window.fetch(url, { + method: 'GET' + }); + return !resp.status.toString().startsWith('4'); + } catch (err) { + console.error(err); + } + + return false; + } + +}; \ No newline at end of file -- cgit v1.2.3-54-g00ecf