基于WebView2实现的Win11桌面框架,利用插件自定义
Moli
2026-08-12 e2d07826ede5c1df0f884ef8a59e0a89c95b7d08
samples/plugins/sample.llm-command-palette/index.html
@@ -529,6 +529,8 @@
      config: {}
    };
    let _resizeTimer;
    const els = {
      statusMark: document.getElementById("statusMark"),
      projectSelect: document.getElementById("projectSelect"),
@@ -653,7 +655,15 @@
      const screenHeight = window.screen && window.screen.availHeight ? window.screen.availHeight : 900;
      const heightLimit = Math.floor(screenHeight * 0.5) + 88;
      const height = explicitHeight || Math.min(Math.ceil(document.body.scrollHeight + 2), heightLimit);
      bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
      if (explicitHeight != null) {
        clearTimeout(_resizeTimer);
        bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
        return;
      }
      clearTimeout(_resizeTimer);
      _resizeTimer = setTimeout(function() {
        bridge.requestResize({ width: Math.ceil(document.body.scrollWidth), height }).catch(() => {});
      }, 50);
    }
    function updatePanelLimits() {