File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 4
4
"start_url" : " sharetarget.html" ,
5
5
"display" : " standalone" ,
6
6
"share_target" : {
7
- "url_template" : " sharetarget.html?title={title}&text={text}&url={url}"
7
+ "url_template" : " sharetarget.html?oldapi=true&title={title}&text={text}&url={url}" ,
8
+ "action" : " sharetarget.html" ,
9
+ "params" : {
10
+ "title" : " title" ,
11
+ "text" : " text" ,
12
+ "url" : " url"
13
+ }
8
14
},
9
15
"icons" : [{
10
16
"src" : " images/icon-16.png" ,
Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ <h1>Web Share Target Test App</h1>
75
75
logText ( "Title shared: " + parsedUrl . searchParams . get ( "title" ) ) ;
76
76
logText ( "Text shared: " + parsedUrl . searchParams . get ( "text" ) ) ;
77
77
logText ( "URL shared: " + parsedUrl . searchParams . get ( "url" ) ) ;
78
+ // We still have the old "url_template" member in the manifest, which is
79
+ // how WST was previously specced and implemented in Chrome. If the user
80
+ // agent uses that method, the "oldapi" parameter will be set.
81
+ if ( parsedUrl . searchParams . get ( "oldapi" ) ) {
82
+ logText ( "Your browser is using the deprecated 'url_template' Web Share "
83
+ + "Target API." , true ) ;
84
+ }
78
85
}
79
86
80
87
window . addEventListener ( 'load' , onLoad ) ;
You can’t perform that action at this time.
0 commit comments