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 storage item scriptlets — add regexp support for items removing #256

Closed
Alex-302 opened this issue Nov 16, 2022 · 6 comments
Closed

Comments

@Alex-302
Copy link
Member

  • add ability to remove a key
  • add regex suppot for matching keys, which have variable part(for example mp_***_mixpanel, generated by Similarweb browser extension)
@slavaleleka
Copy link
Contributor

for removing the key we may consider adding a new scriptlet

@adguard-bot adguard-bot changed the title Improve set-local-storage-item scriptlet Improve set-local-storage-item — support regexp pattern for key Nov 16, 2022
@maximtop maximtop changed the title Improve set-local-storage-item — support regexp pattern for key Add remove-local-storage-item with support of regexp pattern for key Nov 28, 2022
@adguard-bot adguard-bot changed the title Add remove-local-storage-item with support of regexp pattern for key Add 'remove-local-storage-item' with support of regexp pattern for 'key' Jan 16, 2023
@Alex-302

This comment was marked as outdated.

@Alex-302
Copy link
Member Author

@stanislav-atr Any news?)

@slavaleleka
Copy link
Contributor

slavaleleka commented Nov 2, 2023

ability to remove an item from the storage is implemented already: #338

but it looks like there is no way to get all storage keys so scriptlet shall not be able to match the needed ones by the regexp. it means that it's impossible to improve the current implementation and make regular expressions acceptable for storage items removing

@adguard-bot adguard-bot changed the title Add 'remove-local-storage-item' with support of regexp pattern for 'key' Improve storage item scriptlets — add regexp support for items removing Nov 2, 2023
@AdamWr
Copy link
Member

AdamWr commented Nov 2, 2023

Couldn't we use something like Object.keys(localStorage) and then iterate it to check if it contains a specific key which would be matched by regexp?

@slavaleleka
Copy link
Contributor

you're right, we can try that

adguard pushed a commit that referenced this issue Nov 15, 2023
…ms removing #256

Squashed commit of the following:

commit 7d5d6f2
Merge: df0ecb7 612f03d
Author: Adam Wróblewski <[email protected]>
Date:   Wed Nov 15 13:43:54 2023 +0100

    Merge branch 'master' into feature/AG-17608

commit df0ecb7
Author: Adam Wróblewski <[email protected]>
Date:   Wed Nov 15 13:32:31 2023 +0100

    Update docs and add example
    Fix detecting regexp

commit a14c86d
Author: Slava Leleka <[email protected]>
Date:   Wed Nov 15 14:27:22 2023 +0300

    Update description

commit 122693a
Merge: f94268f b50f9c9
Author: Adam Wróblewski <[email protected]>
Date:   Tue Nov 14 19:17:58 2023 +0100

    Merge branch 'master' into feature/AG-17608

commit f94268f
Author: Adam Wróblewski <[email protected]>
Date:   Tue Nov 14 10:39:30 2023 +0100

    Improve storage item scriptlets — add regexp support for items removing
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

5 participants