Skip to content

Commit

Permalink
fix(web): 修复网页版登录界面无法自动填充的问题 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Oct 28, 2022
1 parent 5667daa commit 1bf4622
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
### Fixed

- 留言板中单击网址链接现在能正常转跳到对应网页
- 修复网页版登录界面无法自动填充的问题

## [0.9.1] - 2022-10-22

Expand Down
19 changes: 19 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>

<script type="application/javascript">
// Disable shadow dom for FLT-GLASS-PANE by overriding
// `attachShadow` to avoid the following issue:
// https://github.com/flutter/flutter/issues/87735

Element.prototype._attachShadow = Element.prototype.attachShadow;
Element.prototype.attachShadow = function (init) {
if (this.tagName == "FLT-GLASS-PANE" && window.location.pathname == '/login') {

_element = document.createElement('flt-element-host-node');
this.appendChild(_element);

return _element;
}

return this._attachShadow(init);
};
</script>
</head>
<body>
<script>
Expand Down

0 comments on commit 1bf4622

Please sign in to comment.