Skip to content

Commit 81ebdaf

Browse files
committed
AG-44575 Fix 'google-ima3' — add 'getCreativeId' method to 'Ad.prototype'. #515
Squashed commit of the following: commit adfd4c9 Merge: b375b58 0af817d Author: Adam Wróblewski <adam@adguard.com> Date: Tue Mar 3 15:35:04 2026 +0100 Merge branch 'master' into fix/AG-44575 commit b375b58 Author: Adam Wróblewski <adam@adguard.com> Date: Tue Mar 3 09:47:10 2026 +0100 Add getCreativeId method to google-ima3
1 parent 0af817d commit 81ebdaf

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
1212

1313
## [Unreleased]
1414

15+
### Added
16+
17+
- `getCreativeId` method to `Ad` class in `google-ima3` redirect [#515].
18+
1519
### Changed
1620

1721
- Added `interceptChainProp` helper to share intermediate chain property access logic
@@ -30,6 +34,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
3034

3135
[Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v2.2.16...HEAD
3236
[#513]: https://github.com/AdguardTeam/Scriptlets/issues/513
37+
[#515]: https://github.com/AdguardTeam/Scriptlets/issues/515
3338
[#545]: https://github.com/AdguardTeam/Scriptlets/issues/545
3439
[#549]: https://github.com/AdguardTeam/Scriptlets/issues/549
3540

src/redirects/google-ima3.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { hit, noopFunc, logMessage } from '../helpers';
2020
*/
2121

2222
export function GoogleIma3(source) {
23-
const VERSION = '3.453.0';
23+
const VERSION = '3.746.0';
2424

2525
const ima = {};
2626

@@ -288,6 +288,7 @@ export function GoogleIma3(source) {
288288
getApiFramework: () => null,
289289
getCompanionAds: () => [],
290290
getContentType: () => '',
291+
getCreativeId: () => '',
291292
getCreativeAdId: () => '',
292293
getDealId: () => '',
293294
getDescription: () => '',

tests/redirects/google-ima3.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,22 @@ test('Ima - EventHandler bind context', (assert) => {
210210
done();
211211
});
212212
});
213+
214+
test('Ima - getCreativeId', (assert) => {
215+
evalWrapper(redirects.getRedirect(name).content);
216+
217+
let testPassed;
218+
219+
const adEvent = new window.google.ima.AdEvent();
220+
const ad = adEvent.getAd();
221+
let creativeId;
222+
try {
223+
creativeId = ad.getCreativeId();
224+
testPassed = true;
225+
} catch (error) {
226+
testPassed = false;
227+
}
228+
229+
assert.strictEqual(creativeId, '', 'creativeId is set to empty string');
230+
assert.strictEqual(testPassed, true, 'testPassed set to true');
231+
});

0 commit comments

Comments
 (0)