File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 52
52
< button id ="eme "> Encrypted Media (EME)</ button >
53
53
< button id ="idle-detection "> Idle Detection</ button >
54
54
< button id ="persistent-storage "> Persistent Storage</ button >
55
+ < button id ="open-file-picker "> Open File Picker</ button >
56
+ < button id ="open-directory-picker "> Open Directory Picker</ button >
55
57
< button id ="protocol-handler "> Protocol Handler</ button >
56
58
< button id ="webauthn-attestation "> WebAuthn Attestation</ button >
57
59
< button id ="nfc "> NFC</ button >
Original file line number Diff line number Diff line change @@ -502,6 +502,32 @@ window.addEventListener("load", () => {
502
502
displayOutcome ( "persistent-storage" , "error" ) ,
503
503
) ;
504
504
} ,
505
+ "open-file-picker" : ( ) => {
506
+ if ( "showOpenFilePicker" in window ) {
507
+ window . showOpenFilePicker ( ) . then (
508
+ displayOutcome ( "open-file-picker" , "success" ) ,
509
+ displayOutcome ( "open-file-picker" , "error" ) ,
510
+ ) ;
511
+ } else {
512
+ displayOutcome (
513
+ "open-file-picker" ,
514
+ "error" ,
515
+ ) ( "window.showOpenFilePicker not available" ) ;
516
+ }
517
+ } ,
518
+ "open-directory-picker" : ( ) => {
519
+ if ( "showDirectoryPicker" in window ) {
520
+ window . showDirectoryPicker ( ) . then (
521
+ displayOutcome ( "open-directory-picker" , "success" ) ,
522
+ displayOutcome ( "open-directory-picker" , "error" ) ,
523
+ ) ;
524
+ } else {
525
+ displayOutcome (
526
+ "open-directory-picker" ,
527
+ "error" ,
528
+ ) ( "window.showDirectoryPicker not available" ) ;
529
+ }
530
+ } ,
505
531
506
532
"protocol-handler" : ( ) => {
507
533
// https://www.w3.org/TR/html5/webappapis.html#navigatorcontentutils
You can’t perform that action at this time.
0 commit comments