Skip to content

Commit

Permalink
function refererInfoの、refererInfo.canonicalUrlへ差し替えました。
Browse files Browse the repository at this point in the history
  • Loading branch information
matsumoto-kouichi committed Feb 14, 2022
1 parent 0645db0 commit 001df78
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions modules/gmosspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function getCurrencyType() {
}

function getUrlInfo(refererInfo) {
let canonicalLink = getCanonicalUrl();
let canonicalLink = refererInfo.canonicalUrl;

if (!canonicalLink) {
let metaElements = getMetaElements();
Expand All @@ -164,22 +164,6 @@ function getUrlInfo(refererInfo) {
};
}

function getCanonicalUrl() {
let link;
if (window.self !== window.top) {
try {
link = window.top.document.head.querySelector('link[rel="canonical"][href]');
} catch (e) { }
} else {
link = document.head.querySelector('link[rel="canonical"][href]');
}

if (link) {
return link.href;
}
return '';
}

function getMetaElements() {
try {
return window.top.document.getElementsByTagName('meta');
Expand Down

0 comments on commit 001df78

Please sign in to comment.