File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 8888#
8989` ;
9090
91+ let sharedQuery ;
92+ const hashArgs = new URLSearchParams ( window . location . hash . substring ( 1 ) ) ;
93+ if ( hashArgs . has ( 'query' ) ) {
94+ sharedQuery = hashArgs . get ( 'query' ) ;
95+ // reset url to not motivate copying of stale URL
96+ hashArgs . delete ( 'query' ) ;
97+ let remainingHash = "" ;
98+ if ( hashArgs . size !== 0 ) {
99+ remainingHash = `#${ hashArgs . toString ( ) } ` ;
100+ }
101+ history . pushState ( "" , document . title ,
102+ window . location . pathname + window . location . search + remainingHash
103+ ) ;
104+ }
105+
91106 const fetchURL = window . location . href ;
92107
93108 function httpUrlToWebSockeUrl ( url ) {
123138 defaultEditorToolsVisibility : true ,
124139 plugins : [ explorerPlugin ] ,
125140 inputValueDeprecation : true ,
141+ defaultQuery : EXAMPLE_QUERY ,
142+ query : sharedQuery ,
126143 } ) ,
127144 ) ;
128145 </ script >
You can’t perform that action at this time.
0 commit comments