HEX
Server:Apache
System:Linux localhost 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User:enlugo-es (10006)
PHP:7.4.33
Disabled:opcache_get_status
Upload Files
File: /var/www/vhosts/enlugo.es/httpdocs/wp-content/plugins/w3-total-cache/Generic_WidgetBoldGrid_View.js
jQuery( document ).ready( function( $ ) {
	$( window ).on( 'message', function( event ) {
		var originalEvent  = event.originalEvent,
			expectedOrigin = document.location.protocol + '//' + document.location.hostname,
			message;

		if ( originalEvent.origin !== expectedOrigin ) {
			return;
		}

		if ( originalEvent.data ) {
			try {
				message = $.parseJSON( originalEvent.data );
			} catch ( e ) {
				return;
			}
		}

		if ( ! message || 'undefined' === typeof message.action ) {
			return;
		}

		if (message.action == 'install-plugin') {
			window.location = $('#w3tc-boldgrid-install').prop('href');
		}
	});
});