floating webview size to fit content

I have a floating web view, transparent. I'd like for the height of the view to fit the content, which is variable in height. The issue is that when the content is not so high, I have an invisible part of the view which can't be seen but can be dragged and obscures selection of whatever's below it. Leads to some user confusion.
Is it possible to do this?

unfortunately it's complicated. The webview itself doesn't know about the content size by default.
What I could do is add a function you can call from within the webview which will resize it (something like callBTT("resize", {height: 400, width: 400}. Would that help?

That would be really useful, Andreas.

Is a resize function likely to happen? No pressure but it would be very useful.

It's still on my todo list. I think it's already possible in a basic way by doing something like this:

<html>
<head>
<script>
function doResize() {
(async ()=> {

var updateDefinition = {
    "BTTActionFloatingHTMLConfig" : "{\"BTTSize\":\"{700, 100}\"}"
  };

callBTT('update_trigger', {uuid: '70322112-B835-4276-846A-77321A36EDA7',json: JSON.stringify(updateDefinition)})

returnToBTT('done');

})();
}

</script>
</head>
<body style="background:red; width:100%; height:100%">
test
<button onClick="doResize()">resize</button>
</body>
</html>

(The UUID would be the uuid of the webview trigger, you can get it by right-clicking the trigger)
However this will result in a flicker because it will reload the webview.

However you need to pass the whole webview configuration into the update definition, otherwise it will override your settings.

So a full example would look like this:

Summary
<html>
<head>
<script>
function doResize() {
(async ()=> {

var updateDefinition = {
  "BTTActionFloatingHTMLConfig" : "{\"BTTDoNotCache\":false,\"BTTWebviewClickThrough\":false,\"BTTShowAboveDesktop\":0,\"BTTCloseOnBrowserOpen\":false,\"BTTUseWhiteBackground\":false,\"BTTCenterOnOpen\":false,\"BTTFrameOrigin\":\"{395, 515}\",\"BTTUseFixedPosition\":false,\"BTTWebviewDragEverywhere\":true,\"BTTSize\":\"{700, 100}\",\"BTTCloseOnOutsideClick\":false,\"BTTWebviewResizable\":true,\"BTTWebviewDragEverywhereCMD\":false,\"BTTShowButtons\":false,\"BTTRelativeTo\":0,\"BTTWebViewShowDockIcon\":0,\"BTTWebviewUpdateFrame\":true,\"BTTWebViewManualWindowLevel\":0,\"BTTDrawTitleBezel\":true}"
  };

callBTT('update_trigger', {uuid: '70322112-B835-4276-846A-77321A36EDA7',json: JSON.stringify(updateDefinition)})

returnToBTT('done');

})();
}

</script>
</head>
<body style="background:red; width:100%; height:100%">
test
<button onClick="doResize()">resize</button>
</body>
</html>

Oh I just noticed I implemented your request two weeks ago - at least I started - and then forgot about it.

This should also work (you can also provide x and y if necessary):

<html>
<head>
<script>
function doResize() {
(async ()=> {
callBTT('resize_webview', {"width" :100, "height": 250});
})();
}

</script>
</head>
<body style="background:red; width:100%; height:100%">
test
<button onClick="doResize()">resize</button>
</body>
</html>

that works perfectly. Many thanks, Andreas