We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#51 讨论中,关于 web-like 方案的提案:
interface DwebAppManifest extends CommonManifestV3 { dweb_window_splashscreens: Array<DwebWindowSplashscreens>; } interface DwebWindowSplashscreen { url: URL; baseUrl?: HttpUrl; match?: { /**如果url中有mime,那么会优先使用url中的 */ size?: Size; orientation?: Orientation; theme?: Theme; platform?: Platform; /** * 不同的 platform 会有不同的规则 * 参考 https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform-version */ platformVersion?: string; platformArchitecture?: "x86" | "arm"; platformBitness: "32" | "64"; /** * 参考 NavigatorUAData.mobile * https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/mobile */ mobile?: boolean; }; settings?: { /** 如果是 text/html,默认禁用js,这里可以强制启用 */ enableJavascript?: boolean; /** * 多少毫秒后自动关闭,如果配置,那么时间到后,自动显示成标准窗口 * 同时开发者可以在 应用内 主动通过相关协议接口关闭启动屏幕 * * 如果不配置,那么只能是开发者主动关闭启动屏幕 */ duraction?: number; }; } /**启动屏幕大小 */ type Size = `${number}x${number}` | `${number}` /* 正方形 */; /**启动屏幕方向,会根据当前窗口所在桌面的的衡宽比来进行挑选 */ type Orientation = "portrait" | "landscape"; type Theme = "dark" | "light"; /** * 参考 NavigatorUAData.platform * https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/platform */ type Platform = "Windows" | "iOS" | "Linux" | "macOS" | "Android"; type URL = DataURL | FileURL | HttpUrl; /** * eg: `data:text/html;utf-8,<image src='data:image/png;base64,AAA=='></image>` */ type DataURL = `data:${MIME};${Encoding},${string}`; type MIME = | `text/html` | `image/png` | `image/webp` | `image/gif` | `image/jpeg`; type Encoding = "utf8" | "base64"; /**虚拟文件,必须是受支持的 MIME 类型,会根据文件后缀自己配置mime */ type FileURL = `file:///${string}`; type HttpURL = `https:///${string}`;
有几点需要注意:
PS:现在的 icons 也应该遵循这样的逻辑来。目前的 icons 是基于 window.std.dweb 的 blobCache,这其实并不通用,因为 blobCache 属于 window.std.dweb 自己的缓存。应该将它转化成 DataURL,这样在传递到其它应用的时候仍然可以离线地正确渲染,不造成网络影响。
webview.loadDataWithBaseURL(baseUrl,data,mimeType,encoding)
wkwebview.loadData(data,MIMEType,characterEncodingName,baseURL)
jxbrowser.navigation.loadUrl+interceptCallback
https://${appId}/
appId 通常是 xxx.com.dweb,那么这里的同域的意思是 baseUrl 着必须是 https://xxx.com/ 或者 https://xxx.com.dweb/ 开头
https://xxx.com/
https://xxx.com.dweb/
The text was updated successfully, but these errors were encountered:
dweb+protocol://splashscreen.window.std.dweb/
No branches or pull requests
#51 讨论中,关于 web-like 方案的提案:
有几点需要注意:
webview.loadDataWithBaseURL(baseUrl,data,mimeType,encoding)
wkwebview.loadData(data,MIMEType,characterEncodingName,baseURL)
jxbrowser.navigation.loadUrl+interceptCallback
https://${appId}/
,必须与 appId 同域;如果 url 自身是 HttpURL 格式,那么就会默认作为 baseUrl;The text was updated successfully, but these errors were encountered: