qwen_agent/skills/common/mcp-ui/apps/url.html
2026-05-20 14:54:07 +08:00

34 lines
849 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URL Embed</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { width: 100%; height: 100%; overflow: hidden; }
iframe { width: 100%; height: 100%; border: none; }
</style>
</head>
<body>
<iframe id="frame" sandbox="allow-scripts allow-same-origin allow-forms"></iframe>
<script>
(function () {
function render(payload) {
var frame = document.getElementById('frame');
frame.src = payload.url || '';
}
window.addEventListener('message', function (event) {
var msg = event.data;
if (msg && msg.type === 'mcp-app-data') {
render(msg.payload);
}
});
window.parent.postMessage({ type: 'mcp-app-ready' }, '*');
})();
</script>
</body>
</html>