Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Commit e3a33c2

Browse files
committed
Rename to File System Access
1 parent 612041a commit e3a33c2

7 files changed

Lines changed: 24 additions & 27 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HTML5 Text Editor
22

33
A simple text editor designed to experiement with and demonstrate the
4-
new Native File System APIs.
4+
new File System Access APIs.
55

66
This is not an officially supported Google product.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "text-editor",
3-
"description": "Text Editor - Demo for the HTML5 Native File System.",
4-
"version": "0.0.12",
3+
"description": "Text Editor - Demo for the HTML5 File System Access API.",
4+
"version": "0.0.13",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/GoogleChromeLabs/text-editor.git"

src/humans.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Twitter: @petele
99

1010
/* TECHNOLOGY COLOPHON */
1111

12-
HTML5, CSS3, Native File System APIs
12+
HTML5, CSS3, File System Access APIs

src/index.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<meta name="viewport" content="width=device-width, initial-scale=1">
2525

2626
<!-- SEO description and info -->
27-
<meta name="description" content="Text Editor - Demo for the HTML5 Native File System.">
27+
<meta name="description" content="Text Editor - Demo for the HTML5 File System Access.">
2828
<link rel="canonical" href="https://googlechromelabs.github.io/text-editor/">
2929

3030
<!-- Manifest and icons -->
@@ -46,7 +46,7 @@
4646
<meta name="twitter:card" content="summary">
4747
<meta name="twitter:url" content="https://googlechromelabs.github.io/text-editor/">
4848
<meta name="twitter:title" content="Text Editor">
49-
<meta name="twitter:description" content="Text Editor - Demo for the HTML5 Native File System.">
49+
<meta name="twitter:description" content="Text Editor - Demo for the HTML5 File System Access API.">
5050
<meta name="twitter:image" content="./images/icon-192.png">
5151
<meta name="twitter:creator" content="@petele">
5252

@@ -55,7 +55,7 @@
5555
<meta property="og:type" content="website">
5656
<meta property="og:image" content="./images/icon-192.png">
5757
<meta property="og:url" content="https://googlechromelabs.github.io/text-editor/">
58-
<meta property="og:description" content="Text Editor - Demo for the HTML5 Native File System.">
58+
<meta property="og:description" content="Text Editor - Demo for the HTML5 File System Access API.">
5959

6060
<!-- Analytics -->
6161
<script src="/inline-scripts/analytics.js" inline></script>
@@ -169,20 +169,17 @@ <h1>
169169
</summary>
170170
<div id="not-supported">
171171
The
172-
<a href="https://wicg.github.io/native-file-system/" target="_blank">Native File System API</a>
172+
<a href="https://wicg.github.io/file-system-access/" target="_blank">File System Access API</a>
173173
is <b>not</b> supported in this browser yet, and Text Editor is running
174174
in legacy mode. In legacy mode, the file modified indicators are not shown.
175-
If you're running Chrome, you can enable the Native File System
176-
APIs by enabling the <code>#native-file-system-api</code>
177-
flag in <code>chrome://flags</code>.
178175
</div>
179176
<div>
180177
Text Editor is a simple text editor similar to notepad that makes
181178
it easy to edit text files on your local file system. It shows how
182-
to easily use the new HTML5 Native File System APIs. To learn more
183-
about the Native File System APIs and how this demo was built, check out
184-
<a href="https://web.dev/native-file-system/" target="_blank">
185-
The native file system APIs</a> article on Web Fundamentals, or see the
179+
to easily use the new HTML5 File System Access APIs. To learn more
180+
about the File System Access APIs and how this demo was built, check out
181+
<a href="https://web.dev/file-system-access/" target="_blank">
182+
The file system access APIs</a> article on Web Fundamentals, or see the
186183
<a href="https://github.com/GoogleChromeLabs/text-editor/" target="_blank">
187184
source code on GitHub</a>.
188185
Written by <a href="https://twitter.com/petele" target="_blank">Pete LePage</a>.

src/inline-scripts/app.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ const app = {
3333
monoSpace: false,
3434
wordWrap: true,
3535
},
36-
hasNativeFS: 'chooseFileSystemEntries' in window ||
36+
hasFSAccess: 'chooseFileSystemEntries' in window ||
3737
'showOpenFilePicker' in window,
3838
isMac: navigator.userAgent.includes('Mac OS X'),
3939
};
4040

4141
// Verify the APIs we need are supported, show a polite warning if not.
42-
if (app.hasNativeFS) {
42+
if (app.hasFSAccess) {
4343
document.getElementById('not-supported').classList.add('hidden');
44-
gaEvent('File System APIs', 'Native');
44+
gaEvent('File System APIs', 'FSAccess');
4545
} else {
4646
document.getElementById('lblLegacyFS').classList.toggle('hidden', false);
4747
document.getElementById('butSave').classList.toggle('hidden', true);
@@ -73,8 +73,8 @@ app.openFile = async (fileHandle) => {
7373
return;
7474
}
7575

76-
// If the Native File System API is not supported, use the legacy file apis.
77-
if (!app.hasNativeFS) {
76+
// If the File System Access API is not supported, use the legacy file apis.
77+
if (!app.hasFSAccess) {
7878
gaEvent('FileAction', 'Open', 'Legacy');
7979
const file = await app.getFileLegacy();
8080
if (file) {
@@ -86,13 +86,13 @@ app.openFile = async (fileHandle) => {
8686
// If a fileHandle is provided, verify we have permission to read/write it,
8787
// otherwise, show the file open prompt and allow the user to select the file.
8888
if (fileHandle) {
89-
gaEvent('FileAction', 'OpenRecent', 'Native');
89+
gaEvent('FileAction', 'OpenRecent', 'FSAccess');
9090
if (await verifyPermission(fileHandle, true) === false) {
9191
console.error(`User did not grant permission to '${fileHandle.name}'`);
9292
return;
9393
}
9494
} else {
95-
gaEvent('FileAction', 'Open', 'Native');
95+
gaEvent('FileAction', 'Open', 'FSAccess');
9696
try {
9797
fileHandle = await getFileHandle();
9898
} catch (ex) {
@@ -157,13 +157,13 @@ app.saveFile = async () => {
157157
* Saves a new file to disk.
158158
*/
159159
app.saveFileAs = async () => {
160-
if (!app.hasNativeFS) {
160+
if (!app.hasFSAccess) {
161161
gaEvent('FileAction', 'Save As', 'Legacy');
162162
app.saveAsLegacy(app.file.name, app.getText());
163163
app.setFocus();
164164
return;
165165
}
166-
gaEvent('FileAction', 'Save As', 'Native');
166+
gaEvent('FileAction', 'Save As', 'FSAccess');
167167
let fileHandle;
168168
try {
169169
fileHandle = await getNewFileHandle();
@@ -186,7 +186,7 @@ app.saveFileAs = async () => {
186186
const msg = 'Unable to save file.';
187187
console.error(msg, ex);
188188
alert(msg);
189-
gaEvent('Error', 'Unable to write file', 'Native');
189+
gaEvent('Error', 'Unable to write file', 'FSAccess');
190190
return;
191191
}
192192
app.setFocus();

src/inline-scripts/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
* @param {boolean} val True if the file has been modified.
7070
*/
7171
app.setModified = (val) => {
72-
if (!app.hasNativeFS) {
72+
if (!app.hasFSAccess) {
7373
return;
7474
}
7575
app.file.isModified = val;

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Text Editor",
33
"short_name": "TextEdit",
4-
"description": "Text Editor - Demo for the HTML5 Native File System.",
4+
"description": "Text Editor - Demo for the HTML5 File System Access API.",
55
"start_url": "./",
66
"display": "standalone",
77
"theme_color": "#1a237e",

0 commit comments

Comments
 (0)