aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/franz-custom-website/index.js
blob: 47da782e652af24d10e5889faf4ed1d4ac89550a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";

module.exports = Franz => class CustomWebsite extends Franz {
  async validateUrl(url) {
    try {
      const resp = await window.fetch(url, {
        method: 'GET',
        headers: {
          'Content-Type': 'application/json'
        }
      });
      return resp.status.toString().startsWith('2') || resp.status.toString().startsWith('3');
    } catch (err) {
      console.error(err);
    }

    return false;
  }

};