GoogleChromeLabs で紹介されてる、text-editor は HTMLのFileSystemFileEntryの技術が使われている。この技術を使うとブラウザ上からローカルテキストファイルの読み込み、書き込みが簡単にできる。すごくたまげた。
Git公開
Text-editerのサンプル実行サイト
Text Editor
Text Editor - Demo for the HTML5 File System Access API.
ソースコード
GitHub - GoogleChromeLabs/text-editor: A text editor build on the Native File System APIs
A text editor build on the Native File System APIs - GitHub - GoogleChromeLabs/text-editor: A text editor build on the N...
ローカルで実行するには
srcフォルダのindex.htmlの中のリンクファイルに.をつける
1 2 3 4 5 |
1例: 変更前 index.html(31): <link rel="manifest" href="/manifest.json"> 変更後 index.html(31): <link rel="manifest" href="./manifest.json"> |
FileSystemFileEntryの将来予測
下記MDN-Docsのをみると、現時点で実験的な機能とあるが、
IEの終焉も近くなるなかで、テキストファイルの使ったActivex(FileSystemObject)、HTAアプリケーションについては、Edge + FileSystemFileEntry への置き換えが進みそう。
さらに、Chrome、FileFox などにも使えるというIEを基準にしていた世界ではマルチブラウザも実現でき、ユーザーにとっての選択肢も多くなる。
しかし、できればブラウザでHTMLを起動した時、(onload)で指定したテキストファイルを読み込んでほしい。
![](https://i0.wp.com/papanda925.com/wp-content/uploads/cocoon-resources/blog-card-cache/adec6b7fe735d4bf667370b32e75dcc6.png?resize=160%2C90&ssl=1)
FileSystemFileEntry - Web API | MDN
FileSystemFileEntry はファイルとディレクトリー項目 API のインターフェイスで、ファイルシステム内のファイルを表します。このファイルの属性を記述するプロパティと、そのファイルを読み出すために使用する File オブジェ...
コメント