From 9eed1fa78dd2f8e9e916072d03fc6b8b881c7282 Mon Sep 17 00:00:00 2001 From: iam-py-test <84232764+iam-py-test@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:46:06 -0400 Subject: [PATCH] https://github.com/iam-py-test/my_filters_001/issues/65 --- script.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 script.js diff --git a/script.js b/script.js new file mode 100644 index 0000000..f5b0cbb --- /dev/null +++ b/script.js @@ -0,0 +1,17 @@ +/// cookie-set.js +/// alias cs.js +// example.com##+js(cs, name, value, age) +(() => { + 'use strict'; + const cs = ev => { + if (ev) { window.removeEventListener(ev.type, cs, true); } + try { + document.cookie = '{{1}}={{2}}; max-age={{3}}; secure; path=/;'; + } catch { } + }; + if (document.readyState === 'loading') { + window.addEventListener('DOMContentLoaded', cs, true); + } else { + cs(); + } +})();