Failed to execute 'openDatabase' on 'Window': Access to the WebDatabase API is denied in non-secure contexts

huangapple go评论76阅读模式
英文:

Failed to execute 'openDatabase' on 'Window': Access to the WebDatabase API is denied in non-secure contexts

问题

错误:未知错误 SecurityError:在非安全上下文中拒绝访问 WebDatabase API 执行 'openDatabase'。

JavaScript 代码:
window.openDatabase('teste.db', '1.0', '', 2000 * 1024 * 1024);

期望结果:数据库{版本:'1.0'}。

Chrome 版本 110,在 HTTP 远程地址失败,有解决方案吗?

英文:

Error: Unknown error SecurityError: Failed to execute 'openDatabase' on 'Window': Access to the WebDatabase API is denied in non-secure contexts..

Code javascript:
window.openDatabase('teste.db', '1.0', '', 2000 * 1024 * 1024);

Expecting: Database {version: '1.0'}

Chrome version 110, failed in HTTP remote address, have solution?

答案1

得分: 1

请查看以下链接:
https://chromeenterprise.google/policies/#WebSQLNonSecureContextEnabled

非安全上下文中的WebSQL将在M110版本开始移除。此策略重新启用了该API。如果此策略设置为true,则非安全上下文中的WebSQL将可用。如果此策略设置为false或未设置,则非安全上下文中的WebSQL将在M109之前保持可用,然后在M110版本开始不可用。此更改在M112中移除。

英文:

Check this link:
https://chromeenterprise.google/policies/#WebSQLNonSecureContextEnabled

WebSQL in non-secure contexts will be removed starting M110. This policy re-enables the API. If this policy is set to true, WebSQL in non-secure contexts will be available. If this policy is set to false or unset, WebSQL in non-secure contexts will remain available until M109, then unavailable starting M110. This was removed in M112.

huangapple
  • 本文由 发表于 2023年2月24日 04:03:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75549778.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定