Skip to content

Commit

Permalink
AG-24422 Fix googletagservices-gpt — setPrivacySettings. #344
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 953106b
Merge: 9244d6d 66f6727
Author: Adam Wróblewski <adam@adguard.com>
Date:   Wed Nov 22 17:04:18 2023 +0100

    Merge branch 'master' into fix/AG-24422

commit 9244d6d
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Nov 21 11:05:18 2023 +0100

    Add setPrivacySettings method to googletagservices-gpt
  • Loading branch information
AdamWr committed Nov 23, 2023
1 parent 66f6727 commit 69b5df1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `setPrivacySettings()` method to `googletagservices-gpt` redirect
[#344](https://github.com/AdguardTeam/Scriptlets/issues/344)
- UBO alias `noop.json` for `noopjson` redirect

## [v1.9.96] - 2023-11-15
Expand Down
1 change: 1 addition & 0 deletions src/redirects/googletagservices-gpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export function GoogleTagServicesGpt(source) {
setCookieOptions: noopThis,
setForceSafeFrame: noopThis,
setLocation: noopThis,
setPrivacySettings: noopThis,
setPublisherProvidedId: noopThis,
setRequestNonPersonalizedAds: noopThis,
setSafeFrameConfig: noopThis,
Expand Down
9 changes: 9 additions & 0 deletions tests/redirects/googletagservices-gpt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,12 @@ test('Test updateTargetingFromMap', (assert) => {
);
assert.strictEqual(window.hit, 'FIRED', 'hit function was executed');
});

test('Test setPrivacySettings', (assert) => {
runRedirect(name);

const setPrivacySettings = window.googletag.pubads().setPrivacySettings({});
assert.ok(window.googletag, 'window.googletag have been created');
assert.strictEqual(typeof setPrivacySettings, 'object', 'setPrivacySettings has been mocked');
assert.strictEqual(window.hit, 'FIRED', 'hit function was executed');
});

0 comments on commit 69b5df1

Please sign in to comment.