@@ -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 */
159159app . 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 ( ) ;
0 commit comments