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 adjust-setInterval and adjust-setTimeout #115

Closed
AdamWr opened this issue Feb 2, 2021 · 1 comment
Closed

Improve adjust-setInterval and adjust-setTimeout #115

AdamWr opened this issue Feb 2, 2021 · 1 comment
Assignees
Milestone

Comments

@AdamWr
Copy link
Member

AdamWr commented Feb 2, 2021

I think that it would be nice to have an option to use adjust-setInterval/adjust-setTimeout without specified timeout.
I mean, if there is script like this:

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}
var random = getRandomInt(1000, 2000);

function test() {
 alert(1);
}
window.setTimeout(test, random);

then we will not be able to use adjust-setTimeout, because timeout is "randomized".

@slavaleleka slavaleleka self-assigned this Feb 2, 2021
@slavaleleka slavaleleka added the enhancement Improvement of existent feature label Feb 2, 2021
@slavaleleka slavaleleka added this to the 1.4 milestone Feb 2, 2021
@adguard-bot adguard-bot modified the milestone: 1.4 Feb 2, 2021
@slavaleleka
Copy link
Contributor

@ameshkov should we handle timeout parameter as 1000..2000 for range or just * for any timeout delay?

adguard pushed a commit that referenced this issue Apr 22, 2021
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-6479 to master

Squashed commit of the following:

commit 3b99487
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 11:14:31 2021 +0300

    add consts, comments, renaming + rebuild

commit 5991563
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 10:53:34 2021 +0300

    remove redundant comment

commit 3f66f3f
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 02:50:42 2021 +0300

    rebuild

commit f96729c
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 02:49:44 2021 +0300

    fix notification channel

commit 26ad42e
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 01:43:10 2021 +0300

    fix prevent-setTimeout.test.js

commit 31717dd
Author: Slava Leleka <[email protected]>
Date:   Wed Apr 21 01:15:32 2021 +0300

    improve adjust-set-* scriptlets for any delay parameter, helpers refactor
adguard pushed a commit that referenced this issue Apr 15, 2022
…-161 to master

* commit '52f2451ea0eb851dd2a524f87756d1d319b881e6':
  simplify raf tests
  correct jsdoc
  specify necessary delays for test checking
  improve hit and fix tests
  edit comments
  add tests for prevent-raf
  move test file
  add raf scriptlet + test file
  create raf file
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

3 participants