fossasia/loklak_webclient

View on GitHub
iframely/plugins/links/embedURL/checkEmbedURL.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = {

    provides: '__allowEmbedURL',

    getData: function(meta, whitelistRecord) {

        // Allow slow cheerio parser, if whitelisted,
        // But do not call, if there is twitter:player as it's usually the best one
        if (whitelistRecord.isAllowed('html-meta.embedURL')
            && !(whitelistRecord.isAllowed('twitter.player') && meta.twitter && meta.twitter.card == "player")) {
            return {
                __allowEmbedURL: true
            };
        }
    }
};