Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
checkEnabled(onSuccess) {
// Check if enabled
let plugin = paella.player.config.plugins.list["es.upv.paella.videoDataPlugin"];
let exclude = (plugin && plugin.excludeLocations) || [];
let excludeParent = (plugin && plugin.excludeParentLocations) || [];
let excluded = exclude.some((url) => {
let re = RegExp(url,"i");
return re.test(location.href);
});
if (window!=window.parent) {
excluded = excluded || excludeParent.some((url) => {
let re = RegExp(url,"i");
try {
return re.test(parent.location.href);
}
catch(e) {
// Cross domain error
return false;