Skip to content

Commit

Permalink
in order to support tree-shaking, environment is not an object anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Nasti committed Sep 14, 2022
1 parent bc8175b commit cce094c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/nativeAssetManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import { addNativeClickTrackers, fireNativeImpressionTrackers } from './nativeORTBTrackerManager';
import { sendRequest, loadScript } from './utils';
import {prebidMessenger} from './messaging.js';
import { newEnvironment } from './environment.js';

const envionment = newEnvironment(window);
import { isSafeFrame } from './environment.js';
/*
* Native asset->key mapping from Prebid.js/src/constants.json
* https://github.com/prebid/Prebid.js/blob/8635c91942de9df4ec236672c39b19448545a812/src/constants.json#L67
Expand Down Expand Up @@ -366,7 +364,7 @@ export function newNativeAssetManager(win, pubUrl) {
// current iframe width to the width of the container. This
// is to handle the case where the native ad is rendered inside
// a GAM display ad.
if (!envionment.isSafeFrame()) {
if (!isSafeFrame(window)) {
let iframeContainer = getCurrentFrameContainer(win);
if (iframeContainer && iframeContainer.children && iframeContainer.children[0]) {
const iframe = iframeContainer.children[0];
Expand Down

0 comments on commit cce094c

Please sign in to comment.