Skip to content

Commit

Permalink
iframely protocol: support publishers with custom domain names
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Dec 14, 2024
1 parent b927868 commit 346e3e0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions plugins/links/iframely-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,30 @@ export default {
if (appname) {
appname = appname.toLowerCase();
}

let ignoreIframely = false;
let links = [];

if (appname && Object.keys(meta).some(key => key.indexOf(appname) === 0)) {
ignoreIframely = true;
}

for (const [key, value] of Object.entries(meta)) {
for (const [key, v] of Object.entries(meta)) {
if (key.indexOf(appname) === 0 || (!ignoreIframely && key.indexOf(CONFIG.R.iframely) === 0)) {

const value = typeof(v) === 'string' ? {href: v} : v; // If link has no `media` and no `type` attributes, HTMLMetaHandler assigns the value=href;

let wlr = whitelistRecord;
if (whitelistRecord.isDefault
&& !Array.isArray(value) && value.href) {
wlr = options.getWhitelistRecord(value.href, {exclusiveRel: 'html-meta'});
}

links = links.concat(
utils.parseMetaLinks(
key,
typeof(value) === 'string' ? {href: value} : value, // If link has no `media` and no `type` attributes, HTMLMetaHandler assigns the value=href;
whitelistRecord,
value,
wlr,
ignoreIframely && appname
)
);
Expand Down

0 comments on commit 346e3e0

Please sign in to comment.