[Issue #578] Kantu V5 gotoIf_v1 window.location.href not extracting webpage values anymore


#1

after kantu V5 update on Chrome i expected gotoIf_v1 would work just like before (because documentation says it works like StoreEval), however when i evaluate window.location.href or document.title the values are extracted from the extension window (href returns extension path to popup.html) instead of from the webpage.
it this a bug or?

e.g. when i run the following macro,
StoreEval href includes google = true,
executeScript_Sandbox href includes popup.html = true,
and the gotoIf_v1 lines used to land on label “—>includes google” but after V5 now it lands on label “—>includes popup.html”.

{
  "Name": "000_test_000",
  "CreationDate": "2019-6-5",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://www.google.com/",
      "Value": ""
    },
    {
      "Command": "storeEval",
      "Target": "(window.location.href).includes(\"google\")",
      "Value": "storeEval_result"
    },
    {
      "Command": "echo",
      "Target": "storeEval_result includes google= ${storeEval_result}",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return (window.location.href).includes(\"popup.html\")",
      "Value": "executeScript_Sandbox_result"
    },
    {
      "Command": "echo",
      "Target": "executeScript_Sandbox_result includes popup.html= ${executeScript_Sandbox_result}",
      "Value": ""
    },
    {
      "Command": "gotoIf",
      "Target": "(window.location.href).includes(\"google\")",
      "Value": "--->includes google"
    },
    {
      "Command": "gotoIf",
      "Target": "(window.location.href).includes(\"popup.html\")",
      "Value": "--->includes popup.html"
    },
    {
      "Command": "label",
      "Target": "--->includes google",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "--->includes google",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "label",
      "Target": "--->includes popup.html",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "--->includes popup.html",
      "Value": ""
    }
  ]
}

thanks


#2

Thanks for the good test case. Issue confirmed.


Deprecated if throws error and makes me sad
#3

Issue solved with V5.0.3


#4

wonderful! thank you very much