/** * Enables or disables remote JS console * * Read more at http://jsconsole.com/remote-debugging.html * * @since 1.0.18 * @param bool $enable If set to true, the remote JS console will be enabled, otherwise disabled. * @return mixed Returns the UUID if enabled, true if disabled or false if unable to enable (non-owner) * @api */ public function setRemoteJSConsole($enable) { $uuid = $this->getRemoteJSConsole(); // Check if we own it if enabled if ($uuid && !$this->isRemoteJSConsoleOwned()) { // Already enabled, but not owned by us return false; } // Enable it if ($enable === true) { // If not already enabled, do it now if (!$uuid) { $uuid = $this->internal_options->remote_js_console = Helpers::UUID(); if (!defined('PF4WP_JS_CONSOLE')) { define('PF4WP_JS_CONSOLE', $uuid); } } return $uuid; } // Disable it return ($this->internal_options->remote_js_console = false) === false; }