Skip to content

Commit

Permalink
Pull request #669: AG-24533 AG-16506 AG-21358 Cosmetic rule injection…
Browse files Browse the repository at this point in the history
… in cached iframes

Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-24533 to master

Squashed commit of the following:

commit c4f0bbb
Author: Vladimir Zhelvis <v.zhelvis@adguard.com>
Date:   Mon Sep 18 14:21:47 2023 +0300

    update changelog

commit ad0e93a
Merge: 89ee2fa aaa0e4d
Author: Vladimir Zhelvis <v.zhelvis@adguard.com>
Date:   Mon Sep 18 14:02:37 2023 +0300

    Merge branch 'master' into fix/AG-24533

commit 89ee2fa
Author: Maxim Topciu <mtopciu@adguard.com>
Date:   Mon Sep 18 12:53:23 2023 +0300

    packages/tswebextension/src/lib/mv2/background/web-request-api.ts edited online with Bitbucket

commit a5e079f
Author: Vladimir Zhelvis <v.zhelvis@adguard.com>
Date:   Mon Sep 18 11:32:29 2023 +0300

    fix subdocument frame recording
  • Loading branch information
zhelvis committed Sep 18, 2023
1 parent aaa0e4d commit b66c9f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/tswebextension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- TODO: manually add compare links for version to the end of the file -->
<!-- e.g. [0.1.2]: https://github.com/AdguardTeam/tsurlfilter/compare/tswebextension-v0.1.1...tswebextension-v0.1.2 -->

## Unreleased
## [0.3.19] - 2023-09-18

### Fixed

- `$csp`, `$removeparam` and `$removeheader` allowlist rules not being published as filtering log events
- Cosmetic rule injection in cached subdocument
[#2420](https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2420)
[#2190](https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2190)
[#2328](https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2328)


## [0.3.18] - 2023-09-13
Expand Down
2 changes: 1 addition & 1 deletion packages/tswebextension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adguard/tswebextension",
"version": "0.3.18",
"version": "0.3.19",
"description": "This is a TypeScript library that implements AdGuard's extension API",
"main": "dist/index.js",
"typings": "dist/types/lib/mv2/background/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ import browser, { WebRequest, WebNavigation } from 'webextension-polyfill';
import { RequestType } from '@adguard/tsurlfilter/es/request-type';

import { tabsApi, engineApi } from './api';
import { MAIN_FRAME_ID } from './tabs/frame';
import { Frame, MAIN_FRAME_ID } from './tabs/frame';
import { findHeaderByName } from './utils/headers';
import { isHttpOrWsRequest, getDomain } from '../../common/utils/url';
import { logger } from '../../common/utils/logger';
Expand Down Expand Up @@ -651,10 +651,15 @@ export class WebRequestApi {
return;
}

const frame = tabContext.frames.get(frameId);
let frame = tabContext.frames.get(frameId);

/**
* Subdocument frame context may not be created durning worker request processing.
* We create new one in this case.
*/
if (!frame) {
return;
frame = new Frame(url);
tabContext.frames.set(frameId, frame);
}

/**
Expand Down

0 comments on commit b66c9f7

Please sign in to comment.