From 8e94458ac5c3a731c219ba115c2f0625177ae05e Mon Sep 17 00:00:00 2001 From: Andrew Sotiriou Date: Wed, 16 Feb 2022 13:28:02 -0500 Subject: [PATCH] Update all instances of googletagservices gpt url to securepubads gpt url (#20) * Update all instances of googletagservices gpt url to securepubads gpt url * Add UNSAFE so we can look to update REACT * update remaining paths; use https to avoid redirect Co-authored-by: Andrew Berry --- docs/api/ReactGPT.md | 2 +- examples/apps/routing/app.js | 2 +- scripts/updateAPIList.js | 2 +- src/Bling.js | 4 ++-- test/createManager.spec.js | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api/ReactGPT.md b/docs/api/ReactGPT.md index 3c09344..a885dc0 100644 --- a/docs/api/ReactGPT.md +++ b/docs/api/ReactGPT.md @@ -60,7 +60,7 @@ React GPT makes sure that those APIs are called right before the service is enab Global configuration applies to the all React GPT instances. You can set the following configuration through `Bling.configure(config)`. -* `seedFileUrl` - An optional string for GPT seed file url to override. Default value is `//www.googletagservices.com/tag/js/gpt.js`. +* `seedFileUrl` - An optional string for GPT seed file url to override. Default value is `https://securepubads.g.doubleclick.net/tag/js/gpt.js`. * `renderWhenViewable` - An optional flag to indicate whether an ad should only render when it's fully in the viewport area. Default is `true`. * `viewableThreshold` - An optional number to indicate how much percentage of an ad area needs to be in a viewable area before rendering. Default value is `0.5`. Acceptable range is between `0` and `1.0`. * `filterProps` - An optional function to create an object with filtered current props and next props for a given keys to perform equality check. Default value is [`filterProps`](../../src/utils/filterProps.js). diff --git a/examples/apps/routing/app.js b/examples/apps/routing/app.js index b792b92..e046b3e 100644 --- a/examples/apps/routing/app.js +++ b/examples/apps/routing/app.js @@ -72,7 +72,7 @@ class AppContainer extends Component { routeComponent: this.routes["/Travel/Europe"].component }; - componentWillMount() { + UNSAFE_componentWillMount() { this.unlisten = this.history.listen(location => { const route = this.routes[location.pathname] || this.routes["/Travel/Europe"]; diff --git a/scripts/updateAPIList.js b/scripts/updateAPIList.js index 42d441a..bef8c63 100644 --- a/scripts/updateAPIList.js +++ b/scripts/updateAPIList.js @@ -48,7 +48,7 @@ phantom.create().then(function (ph) { } }); page.open(process.cwd() + "/scripts/empty.html").then(function () { - page.includeJs("http://www.googletagservices.com/tag/js/gpt.js").then(function () { + page.includeJs("https://securepubads.g.doubleclick.net/tag/js/gpt.js").then(function () { setTimeout(function () { page.evaluate(function () { var EXCLUDES = ["constructor"].concat(Object.getOwnPropertyNames(Object.getPrototypeOf({}))); diff --git a/src/Bling.js b/src/Bling.js index c035654..550c007 100644 --- a/src/Bling.js +++ b/src/Bling.js @@ -237,7 +237,7 @@ class Bling extends Component { /** * An optional string for GPT seed file url to override. */ - seedFileUrl: "//www.googletagservices.com/tag/js/gpt.js", + seedFileUrl: "https://securepubads.g.doubleclick.net/tag/js/gpt.js", /** * An optional flag to indicate whether an ad should only render when it's fully in the viewport area. Default is `true`. */ @@ -406,7 +406,7 @@ class Bling extends Component { .catch(this.onScriptError.bind(this)); } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { const {propsEqual} = Bling._config; const {sizeMapping} = this.props; if ( diff --git a/test/createManager.spec.js b/test/createManager.spec.js index 1e563b2..071ffb2 100644 --- a/test/createManager.spec.js +++ b/test/createManager.spec.js @@ -101,7 +101,7 @@ describe("createManager", () => { it("loads gpt", done => { adManager - .load("//www.googletagservices.com/tag/js/gpt.js") + .load("//securepubads.g.doubleclick.net/tag/js/gpt.js") .then(result => { expect(result).to.be.an("object"); expect(adManager.isLoaded).to.be.true; @@ -113,7 +113,7 @@ describe("createManager", () => { it("uses gpt when already exists", done => { window.googletag = googletag; adManager - .load("//www.googletagservices.com/tag/js/gpt-invalid.js") + .load("//securepubads.g.doubleclick.net/tag/js/gpt-invalid.js") .then(() => { expect(adManager.isLoaded).to.be.true; done(); @@ -132,7 +132,7 @@ describe("createManager", () => { it("handles invalid url", done => { adManager = createManager(); adManager - .load("//www.googletagservices.com/tag/js/gpt-invalid.js") + .load("//securepubads.g.doubleclick.net/tag/js/gpt-invalid.js") .catch(err => { expect(err.message).to.equal("failed to load script"); done();