humanemulator.net — справка. Продукт, демо и покупка — на хуманэмулятор.рф | Демо | Купить | API | лог изменений
К объекту raw

clear_disabled_response_urls_array

clear_disabled_response_urls_array(); - очистить массив с урлами, на которые запрещена отправка информации из браузера. Доступна с версии 4.10.1

После отработки функция возвращает результат своей работы в скрипт :
  • true – успешно
  • false – не удалось

    Пример использования
    <?php
    // Scenario: Demonstrates how to clear disabled response URLs array and add new restrictions for canvas.js
    $xhe_host = "localhost:7010";
    if (!isset($path)){
        // Path to the init.php file for connecting to the XHE API
        $path = "../../../Templates/init.php";
        // Including init.php grants access to all classes and functionality for working with the XHE API
        require($path);
    }
    
    // Start
    echo "\n<font color=blue>raw->".basename (__FILE__)."</font>\n";
    
    // Step 1: Enable monitoring
    echo "1. Enable monitoring: ";
    $enableResult = WEB::$raw->enable_all_streams(true);
    echo $enableResult."\n";
    
    // Step 2: Clear disabled response URLs array
    echo "2. Clear disabled response URLs array: ";
    $clearResult = WEB::$raw->clear_disabled_response_urls_array();
    echo $clearResult."\n";
    
    // Step 3: Add disabled response URL for canvas.js
    echo "3. Add disabled response URL: ";
    $disabledUrl = "canvas.js";
    $addResult = WEB::$raw->add_disabled_response_url($disabledUrl);
    echo $addResult."\n";
    
    // Step 4: Navigate to canvas fingerprinting test page
    echo "4. Navigate to canvas fingerprinting test page: ";
    $testUrl = "https://browserleaks.com/canvas";
    $navigateResult = WEB::$browser->navigate($testUrl);
    echo $navigateResult."\n";
    
    // End
    echo "\n";
    
    // Quit the application
    WINDOW::$app->quit();
    ?>
    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
    
    xhe_host = "127.0.0.1:7012"
    from xweb_human_emulator import *
    
    # начало
    echo("<hr><font color=blue>raw.xxxxxxxxx</font><hr>")
    
    # 1 
    echo("1. Включить слежение за http : ")
    echo(raw.enable_all_streams(true),"<br>")
    
    # 2
    echo("2. Очистим массивы запрещенных урлов : ")
    echo(raw.clear_disabled_response_urls_array(),"\n")
    
    # 3
    echo("3. Добавим запрет на отгрузку : ")
    echo(raw.add_disabled_response_url("canvas.js"),"\n")
    
    # 4
    echo("4. Перейдем на проверку canvas finger print : ")
    echo(browser.navigate("https://browserleaks.com/canvas"),"\n")
    
    # конец
    echo("<hr><br>")
    
    # Quit
    app.quit()
    #region using
    
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
    
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
    
    #endregion
    
     class Program:XHEScript
     {
    	  static void Main(string[] args)
    	  {
    			// init XHE
    			server = "localhost:7010";
    			InitXHE();
    
    			// начало
    			echo("<hr><font color=blue>raw.clear_disabled_response_urls_array</font><hr>");
    				
    			// 1 
    			echo("1. Включить слежение за http : ");
    			echo(raw.enable_all_streams(true)+"<br>");
    
    			// 2
    			echo("2. Очистим массивы запрещенных урлов : ");
    			echo(raw.clear_disabled_response_urls_array()+"\n");
    
    			// 3
    			echo("3. Добавим запрет на отгрузку : ");
    			echo(raw.add_disabled_response_url("canvas.js")+"\n");
    
    			// 4
    			echo("4. Перейдем на проверку canvas finger print : ");
    			echo(browser.navigate("https://browserleaks.com/canvas")+"\n");
    
    			// конец
    			echo("\n\n");
    
    			app.quit();            
    	  }
    }
    // подключим функциональные объекты, если еще не подключен
    xhe_host="127.0.0.1:705";
    echo=require("../../../Templates JS/init.js");
    
    // начало
    echo("<hr><font color=blue>raw.clear_disabled_response_urls_array</font><hr>");
    	
    // 1 
    echo("1. Включить слежение за http : ");
    echo(raw.enable_all_streams(true)+"<br>");
    
    // 2
    echo("2. Очистим массивы запрещенных урлов : ");
    echo(raw.clear_disabled_response_urls_array()+"\n");
    
    // 3
    echo("3. Добавим запрет на отгрузку : ");
    echo(raw.add_disabled_response_url("canvas.js")+"\n");
    
    // 4
    echo("4. Перейдем на проверку canvas finger print : ");
    echo(browser.navigate("https://browserleaks.com/canvas")+"\n");
    
    // конец
    echo("\n");
    
    app.quit();

    =============================================
    Raw    Объекты    DOM  System  Vision  Web  Window        
    =============================================
    если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
    .