Skip to content

Commit

Permalink
https://github.com/iam-py-test/my_filters_001/issues/65
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-py-test authored Jun 23, 2021
1 parent b5a9e55 commit 9eed1fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -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();
}
})();

0 comments on commit 9eed1fa

Please sign in to comment.