aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/franz-custom-website/index.js
blob: 62f4218b45bc96b319098247a6f209f37531d291 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
  }

};