zabbix_export:
  version: '7.0'
  host_groups:
    - uuid: 748ad4d098d447d492bb935c907f652f
      name: Databases
  hosts:
    - host: 'Host for crash on setScriptTimeout'
      name: 'Host for crash on setScriptTimeout'
      groups:
        - name: Databases
      interfaces:
        - interface_ref: if1
      items:
        - name: setScriptTimeout
          type: BROWSER
          key: set.script.timeout
          trends: '0'
          status: DISABLED
          value_type: TEXT
          params: |
            var browser = new Browser(Browser.chromeOptions())
            var params = JSON.parse(value);
            
            try {
              browser.navigate(params.url)
               browser.setScriptTimeout(1)
            
              browser.executeScript("performance.mark('m1')")
              browser.executeScript("performance.mark('m2')")  
            
              browser.executeScript("performance.measure('ms1')")
              browser.executeScript("performance.measure('ms2')")
            
              console.warn(browser.executeScript("return performance.getEntriesByType('mark')"))
              console.warn(browser.executeScript("return performance.getEntriesByType('measure')"))
            
              browser.collectPerfEntries("mandarin data")
              JSON.stringify(browser.getResult())
            }
            catch (e) {
              throw e
            }
            
            return JSON.stringify(browser.getResult())
          description: |
		Hello world!            

            #define BROWSER_EXECUTE_SCRIPT
          parameters:
            - name: url
              value: 'http://{$IP}/zbx-24473-6.5/zabbix.php?action=host.list'
      macros:
        - macro: '{$IP}'
          value: 192.168.6.197
      inventory_mode: DISABLED