Added native auto-fill support for URL input in Chrome.

This commit is contained in:
Gunther Brunner
2014-07-31 16:54:09 +09:00
parent e6465fe8cc
commit 8696f833c2
8 changed files with 254 additions and 190 deletions

View File

@@ -0,0 +1,28 @@
# enable-autofill
This directive enables autofill (HTML5 autocomplete) on the selected form.
Currently this is only needed in `Chrome` because `autofill` only works on form `POST` method.
Based on [this](http://stackoverflow.com/questions/16445463/how-to-get-chrome-to-autofill-with-asynchronous-post/22191041#22191041).
## Usage
```html
<form enable-autofill action="about:blank">
<input type="text" autocomplete="on">
</form>
```
This will create the following DOM:
```html
<iframe src="about:blank" name="_autofill" style="display:none">
<form method="post" action="about:blank" target="_autofill">
<input type="text" autocomplete="on">
</form>
```
Yes, it is a bit ugly but it is currently the only way.
It will create only one `iframe` which will be reused.