Skip to content

Commit

Permalink
update changelog and fix typos in test
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Dec 20, 2022
1 parent 6973376 commit 25c9820
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 28 deletions.
53 changes: 30 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
# Scriptlets and Redirect Resources Changelog

## 1.8.0

### Fixed

- `prevent-xhr` and `trusted-replace-xhr-response` closure bug on multiple requests [#261](https://github.com/AdguardTeam/Scriptlets/issues/261)


## v1.7.10

### Added

* new scriptlet `trusted-set-cookie-reload`
- new scriptlet `trusted-set-cookie-reload`

### Fixed

* `set-cookie-reload` infinite page reloading [#265](https://github.com/AdguardTeam/Scriptlets/issues/265)
* breakage of `prevent-element-src-loading` due to `window` getting into `apply` wrapper [#264](https://github.com/AdguardTeam/Scriptlets/issues/264)
* spread of args bug at `getXhrData` call for `trusted-replace-xhr-response`
* request properties array not being served to `getRequestData` and `parseMatchProps` helpers
- `set-cookie-reload` infinite page reloading [#265](https://github.com/AdguardTeam/Scriptlets/issues/265)
- breakage of `prevent-element-src-loading` due to `window` getting into `apply` wrapper [#264](https://github.com/AdguardTeam/Scriptlets/issues/264)
- spread of args bug at `getXhrData` call for `trusted-replace-xhr-response`
- request properties array not being served to `getRequestData` and `parseMatchProps` helpers

## v1.7.3

### Added

* [Trusted scriptlets](./README.md#trusted-scriptlets) with extended capabilities:
* trusted-click-element [#23](https://github.com/AdguardTeam/Scriptlets/issues/23)
* trusted-replace-xhr-response [#202](https://github.com/AdguardTeam/Scriptlets/issues/202)
* trusted-replace-fetch-response
* trusted-set-local-storage-item
* trusted-set-cookie
- [Trusted scriptlets](./README.md#trusted-scriptlets) with extended capabilities:
- trusted-click-element [#23](https://github.com/AdguardTeam/Scriptlets/issues/23)
- trusted-replace-xhr-response [#202](https://github.com/AdguardTeam/Scriptlets/issues/202)
- trusted-replace-fetch-response
- trusted-set-local-storage-item
- trusted-set-cookie

* Scriptlets:
* xml-prune [#249](https://github.com/AdguardTeam/Scriptlets/issues/249)
- Scriptlets:
- xml-prune [#249](https://github.com/AdguardTeam/Scriptlets/issues/249)

### Improved

* Scriptlets:
* prevent-element-src-loading [#228](https://github.com/AdguardTeam/Scriptlets/issues/228)
* prevent-fetch [#216](https://github.com/AdguardTeam/Scriptlets/issues/216)
* abort-on-stack-trace [#201](https://github.com/AdguardTeam/Scriptlets/issues/201)
* abort-current-inline-script [#251](https://github.com/AdguardTeam/Scriptlets/issues/251)
* set-cookie & set-cookie-reload
* Redirects:
* google-ima3 [#255](https://github.com/AdguardTeam/Scriptlets/issues/255)
* metrika-yandex-tag [#254](https://github.com/AdguardTeam/Scriptlets/issues/254)
* googlesyndication-adsbygoogle [#252](https://github.com/AdguardTeam/Scriptlets/issues/252)
- Scriptlets:
- prevent-element-src-loading [#228](https://github.com/AdguardTeam/Scriptlets/issues/228)
- prevent-fetch [#216](https://github.com/AdguardTeam/Scriptlets/issues/216)
- abort-on-stack-trace [#201](https://github.com/AdguardTeam/Scriptlets/issues/201)
- abort-current-inline-script [#251](https://github.com/AdguardTeam/Scriptlets/issues/251)
- set-cookie & set-cookie-reload
- Redirects:
- google-ima3 [#255](https://github.com/AdguardTeam/Scriptlets/issues/255)
- metrika-yandex-tag [#254](https://github.com/AdguardTeam/Scriptlets/issues/254)
- googlesyndication-adsbygoogle [#252](https://github.com/AdguardTeam/Scriptlets/issues/252)
8 changes: 3 additions & 5 deletions tests/scriptlets/trusted-replace-xhr-response.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ if (isSupported) {
const URL_TO_BLOCK = `${FETCH_OBJECTS_PATH}/test01.json`;
const PATTERN = '*';
const REPLACEMENT = '';
const MATCH_DATA = [PATTERN, REPLACEMENT, `${URL}`];
const MATCH_DATA = [PATTERN, REPLACEMENT, 'test01'];

runScriptlet(name, MATCH_DATA);

Expand All @@ -217,19 +217,17 @@ if (isSupported) {
xhr2.open(METHOD, URL_TO_BLOCK);

xhr1.onload = () => {
console.log(xhr1.response);
assert.strictEqual(xhr1.readyState, 4, 'Response done');
assert.ok(xhr1.response.includes(INTACT_RESPONSE_PART), 'Response is intact');

assert.strictEqual(window.hit, undefined, 'hit should not fire');
done1();
};

xhr2.onload = () => {
assert.strictEqual(xhr2.readyState, 4, 'Response done');
assert.notOk(xhr2.response === '', 'Response has been removed');
assert.ok(xhr2.response === '', 'Response has been removed');

assert.strictEqual(window.hit, undefined, 'hit function fired');
assert.strictEqual(window.hit, 'FIRED', 'hit function fired');
done2();
};

Expand Down

0 comments on commit 25c9820

Please sign in to comment.