Cannot open webviews via Javascript action since 4.109

Describe the bug
I have a few Javascript triggers that call a webview via a named trigger directly after setting a string variable, but something changed between 4.108 and 4.109 and now these no longer work. There's no crash, but BTT becomes completely unresponsive unless I kill & restart it - spinning beach ball of death if I try to click on its menu bar icon or anywhere in the UI. Apologies for spamming you with multiple bugs today!

Device information:

  • Type of Mac: M1 Air
  • macOS version: 12.5.1
  • BetterTouchTool version: 4.009 (and later versions)

Additional information:
I've done some version comparisons and these types of actions definitely worked for me up to and including v4.008. Minimum (hopefully) reproducible example:

kbd/javascript trigger:

[
  {
    "BTTTriggerType": 0,
    "BTTTriggerClass": "BTTTriggerTypeKeyboardShortcut",
    "BTTPredefinedActionType": 281,
    "BTTPredefinedActionName": "Run Real JavaScript",
    "BTTGenericActionConfig": "(async () => {\n\n    await callBTT(\"set_string_variable\", { variable_name: \"foobar\", to: \"success\" });\n\n    await callBTT(\"trigger_named\", { trigger_name: \"webview.TEST\" });\n\n    returnToBTT();\n\n})();\n",
    "BTTRealJavaScriptString": "(async () => {\n\n    await callBTT(\"set_string_variable\", { variable_name: \"foobar\", to: \"success\" });\n\n    await callBTT(\"trigger_named\", { trigger_name: \"webview.TEST\" });\n\n    returnToBTT();\n\n})();\n",
    "BTTAdditionalConfiguration": "270336",
    "BTTEnabled2": 1,
    "BTTKeyboardShortcutScope": 0,
    "BTTKeyboardShortcutKeyboardType": 3809,
    "BTTRepeatDelay": 0,
    "BTTUUID": "5C3F671B-1525-454A-B8AA-C47B5FCF755A",
    "BTTTriggerOnDown": 1,
    "BTTNotesInsteadOfDescription": 0,
    "BTTLayoutIndependentChar": "\/",
    "BTTEnabled": 1,
    "BTTModifierMode": 0,
    "BTTShortcutKeyCode": 44,
    "BTTShortcutModifierKeys": 262144,
    "BTTOrder": 1,
    "BTTDisplayOrder": 0,
    "BTTAutoAdaptToKeyboardLayout": 0,
    "BTTTriggerConfig": {
      "BTTLeftRightModifierDifferentiation": 1
    }
  }
]

webview named trigger:

[
  {
    "BTTGestureNotes": "Named Trigger: webview.TEST",
    "BTTTriggerType": 643,
    "BTTTriggerTypeDescription": "Named Trigger: webview.TEST",
    "BTTTriggerClass": "BTTTriggerTypeOtherTriggers",
    "BTTPredefinedActionType": 249,
    "BTTPredefinedActionName": "Show Floating WebView\/HTML Menu",
    "BTTGenericActionConfig2": "{\"BTTCloseOnOutsideClick\":false,\"BTTWebviewClickThrough\":false,\"BTTWebviewDragEverywhereCMD\":false,\"BTTWebviewResizable\":false,\"BTTWebviewDragEverywhere\":false,\"BTTWebViewManualWindowLevel\":0,\"BTTDrawTitleBezel\":false,\"BTTShowAboveDesktop\":0,\"BTTDoNotCache\":true,\"BTTWebViewPreload\":false,\"BTTWebViewShowDockIcon\":0,\"BTTCloseOnBrowserOpen\":false,\"BTTCenterOnOpen\":true,\"BTTTitlebarStyle\":1,\"BTTSize\":\"{200, 200}\",\"BTTRelativeTo\":0,\"BTTUseFixedPosition\":false,\"BTTShowButtons\":false,\"BTTWebviewUpdateFrame\":false,\"BTTWebViewKeepVisibleAndRefreshINT\":1,\"BTTUseWhiteBackground\":true,\"BTTFrameOrigin\":\"{0, 0}\"}",
    "BTTActionFloatingHTMLName": "",
    "BTTActionFloatingHTMLConfig": "{\"BTTCloseOnOutsideClick\":false,\"BTTWebviewClickThrough\":false,\"BTTWebviewDragEverywhereCMD\":false,\"BTTWebviewResizable\":false,\"BTTWebviewDragEverywhere\":false,\"BTTWebViewManualWindowLevel\":0,\"BTTDrawTitleBezel\":false,\"BTTShowAboveDesktop\":0,\"BTTDoNotCache\":true,\"BTTWebViewPreload\":false,\"BTTWebViewShowDockIcon\":0,\"BTTCloseOnBrowserOpen\":false,\"BTTCenterOnOpen\":true,\"BTTTitlebarStyle\":1,\"BTTSize\":\"{200, 200}\",\"BTTRelativeTo\":0,\"BTTUseFixedPosition\":false,\"BTTShowButtons\":false,\"BTTWebviewUpdateFrame\":false,\"BTTWebViewKeepVisibleAndRefreshINT\":1,\"BTTUseWhiteBackground\":true,\"BTTFrameOrigin\":\"{0, 0}\"}",
    "BTTTriggerName": "webview.TEST",
    "BTTEnabled2": 1,
    "BTTAlternateModifierKeys": 0,
    "BTTRepeatDelay": 0,
    "BTTUUID": "5B59BAAB-24E0-4130-8F17-2C44E3F18B43",
    "BTTNotesInsteadOfDescription": 0,
    "BTTEnabled": 1,
    "BTTModifierMode": 0,
    "BTTOrder": 2,
    "BTTDisplayOrder": 0,
    "BTTFiles": [
      {
        "BTTFileContent": "PGhlYWQ+CiAgICA8c2NyaXB0PgogICAgICAgIGFzeW5jIGZ1bmN0aW9uIEJUVEluaXRpYWxpemUoKSB7CiAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiN0ZXN0IikuaW5uZXJUZXh0ID0gYXdhaXQgY2FsbEJUVCgiZ2V0X3N0cmluZ192YXJpYWJsZSIsIHsgdmFyaWFibGVfbmFtZTogImZvb2JhciIgfSk7CgogICAgICAgICAgICBhd2FpdCBjYWxsQlRUKCJzZXRfc3RyaW5nX3ZhcmlhYmxlIiwgeyB2YXJpYWJsZV9uYW1lOiAiZm9vYmFyIiwgdG86ICIiIH0pOwogICAgICAgIH0KICAgIDwvc2NyaXB0Pgo8L2hlYWQ+Cgo8Ym9keT4KICAgIDxoMSBpZD0idGVzdCI+PC9oMT4KPC9ib2R5Pg==",
        "BTTFileOther": "html"
      }
    ]
  }
]

ah thanks I was wondering whether that change broke anything :see_no_evil: will fix that.

Amazing, thanks! I triple-checked this time when I compared versions to make sure I wasn't just being a noob and overlooking some setting somewhere!

would be great if you could test your setup with 4.014

Yes that seems to have done the trick, thanks :+1:

1 Like