From fc5890bb72fc2e4b8a9a398bac59bfb64b653bc4 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:54:35 +0800 Subject: [PATCH] use a module to check --- scripts/external/check.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/external/check.js diff --git a/scripts/external/check.js b/scripts/external/check.js new file mode 100644 index 0000000..3f01663 --- /dev/null +++ b/scripts/external/check.js @@ -0,0 +1,19 @@ +/* +check.js + +Check if a website is supported. +*/ + +import filters from '/scripts/filters.js'; + +export default class check { + /* + Check if an e-commerce platform is supported. + + @param {string} URL + @returns {object} the support state + */ + static async platform (URL = window.location.href) { + return (await ((new filters).select(URL))); + } +} \ No newline at end of file