Skip to content

Commit

Permalink
AG-27289 try inject script on response started for new tabs
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/tsurlfilter from fix/AG-27289 to master

Squashed commit of the following:

commit 09b57e6
Merge: 07b47f6 d2ea006
Author: Maxim Topciu <[email protected]>
Date:   Tue Nov 7 17:02:18 2023 +0200

    Merge branch 'master' into fix/AG-27289

commit 07b47f6
Author: Maxim Topciu <[email protected]>
Date:   Tue Nov 7 16:22:53 2023 +0200

    AG-27289 add comments

commit 353810a
Author: Maxim Topciu <[email protected]>
Date:   Tue Nov 7 11:11:48 2023 +0200

    AG-27289 update changelog

commit 4ee0071
Author: Maxim Topciu <[email protected]>
Date:   Fri Nov 3 22:37:01 2023 +0200

    AG-27289 try inject script on before request for new tabs
  • Loading branch information
maximtop committed Nov 7, 2023
1 parent d2ea006 commit 43659dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/tswebextension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Ads displayed on the first visit on 'pikabu.ru' [#2571](https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2571)

### Added
- Added new `ExtensionStorage`, `PersistentValueContainer`, `createExtensionStorageDecorator` interfaces and for restoring data in event-driven background scripts [#2286](https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2286).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,13 @@ export class WebRequestApi {
* that tab navigation steel is being processed and js injection may be causing the error.
* In this case, js will be injected in the {@link WebNavigation.onCommitted} event.
*/
if (requestType === RequestType.Document && frame.url !== tabContext.info.url) {
if (requestType === RequestType.Document
/**
* Check if url exists because it might be empty for new tabs.
* In this case we may inject on response started
* (https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2571).
*/
&& tabContext.info.url && tabContext.info.url !== frame.url) {
return;
}

Expand Down

0 comments on commit 43659dc

Please sign in to comment.