【发布时间】:2019-08-18 07:28:47
【问题描述】:
我想知道是否可以在 UWP 中做类似于 Stylish 为浏览器所做的事情,因为我已经为我在 WebView 中使用的网页编写了 CSS,但是这个网页有一个 iframe,所以我需要将 CSS 应用于以"https://webchat.botframework.com/" 开头的所有 URL 以使其正常工作(在 Stylish 上)
<WebView x:Name="WebView1" Source="https://www.blabla.net/bla/webchat.html" Width="490" Height="490" HorizontalAlignment="Center"/>
网页代码
<body>
<iframe lang="fr-FR" id="chat" style="width: 60vw; height: 95vh; margin-left: 20vw" src=''></iframe>
<script>
document.getElementById("chat").src =
"https://webchat.botframework.com/embed/BitWcVaClient2?userid=" + create_UUID() +
"&username=WW&v=4.2&l=fr-FR&s=ceraZE8go0A.lpa7tzuJ1H_rOJdJKWXibqg_aBrVQrHhhd432kU2e-M";
function create_UUID() {
var dt = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (dt + Math.random() * 16) % 16 | 0;
dt = Math.floor(dt / 16);
return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
});
return uuid;
}
</script>
</body>
【问题讨论】:
标签: javascript c# css webview uwp-xaml