File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,10 +215,9 @@ plots.sendDataToCloud = function(gd, serverURL) {
215215 // the chart back to it once Cloud reports that authentication succeeded.
216216 // Pass the current page's origin as a query string so Cloud knows where to
217217 // send the CHART_AUTH_SUCCESS message back to.
218- var uploadUrl = serverURL +
219- ( serverURL . indexOf ( '?' ) === - 1 ? '?' : '&' ) +
220- 'origin=' + encodeURIComponent ( window . location . origin ) ;
221- var cloudWindow = window . open ( uploadUrl , '_blank' ) ;
218+ var uploadUrl = new URL ( serverURL ) ;
219+ uploadUrl . searchParams . set ( 'origin' , window . location . origin ) ;
220+ var cloudWindow = window . open ( uploadUrl . href , '_blank' ) ;
222221 if ( ! cloudWindow ) {
223222 console . error ( 'Unable to open Plotly Cloud (the popup may have been blocked)' ) ;
224223 gd . emit ( 'plotly_exportfail' ) ;
You can’t perform that action at this time.
0 commit comments