Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve set-cookie scriptlet with optional page reload #111

Closed
superlex opened this issue Dec 28, 2020 · 4 comments
Closed

Improve set-cookie scriptlet with optional page reload #111

superlex opened this issue Dec 28, 2020 · 4 comments

Comments

@superlex
Copy link

Some sites need to be reloaded after a cookie was set.

An option to reload the page could be added to scriptlet syntax.
Example:

example.org#%#//scriptlet('set-cookie', 'checking', 'ok', 'reload')

equivalent to

example.org#%#(function(){-1==document.cookie.indexOf("checking")&&(document.cookie="checking=ok; path=/;",location.reload())})();

@ameshkov
Copy link
Member

We need an example of such a website

@superlex
Copy link
Author

superlex commented Dec 28, 2020

Correct me if I'm wrong:

example website: it.readly.com

Using

readly.com#%#//scriptlet('set-cookie', 'ReadlyCookieConsent', '1')

you need to manually reload the page, so you have to use

readly.com#%#(function(){-1==document.cookie.indexOf("ReadlyCookieConsent")&&(document.cookie="ReadlyCookieConsent=1; path=/;",location.reload())})();

instead.

@ameshkov ameshkov added the Feature request Adding new feature label Dec 29, 2020
@ameshkov
Copy link
Member

Yeah, it seems to be the case, thank you!

@superlex
Copy link
Author

You're welcome, thanks to you :)

@slavaleleka slavaleleka added this to the 1.4 milestone Jan 12, 2021
@adguard-bot adguard-bot removed this from the 1.4 milestone Jan 12, 2021
@slavaleleka slavaleleka added this to the 1.4 milestone Jan 12, 2021
adguard pushed a commit that referenced this issue Jan 18, 2021
Merge in ADGUARD-FILTERS/scriptlets from feature/AG-6035 to master

Squashed commit of the following:

commit d1c7896
Author: Slava Leleka <[email protected]>
Date:   Mon Jan 18 15:39:20 2021 +0300

    fix description

commit f833471
Author: Slava Leleka <[email protected]>
Date:   Thu Jan 14 17:03:25 2021 +0300

    add set-cookie-reload scriptlet

commit 01d848c
Author: Slava Leleka <[email protected]>
Date:   Wed Jan 13 10:50:47 2021 +0300

    rebuild

commit d880010
Author: Slava Leleka <[email protected]>
Date:   Wed Jan 13 10:32:14 2021 +0300

    upgrade yarn

commit 3ca54b6
Author: Slava Leleka <[email protected]>
Date:   Wed Jan 13 01:31:34 2021 +0300

    update caniuse-lite

commit 1207659
Author: Slava Leleka <[email protected]>
Date:   Wed Jan 13 00:36:44 2021 +0300

    add option 'reload' flag for set-cookie
adguard pushed a commit that referenced this issue Apr 15, 2022
… to master

* commit 'db491a792635caa6e43e3cdba2f0694f73b99660':
  add comment about redirects source.engine using in tests
  add test for code checking by alias name
  remove eslint comments
  make scriptlets/redirects tests work separately
  divide tests for scriptlets and redirects
  iframes was -> were
  improve googlesyndication-adsbygoogle + tests
  gitignore tests/dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants