+ // Expose the changeset UUID on the parent window's URL so that the customized state can survive a refresh.
+ if ( history.replaceState ) {
+ this.messenger.bind( 'changeset-uuid', function( changesetUuid ) {
+ var urlParser = document.createElement( 'a' );
+ urlParser.href = location.href;
+ urlParser.search = $.param( _.extend(
+ api.utils.parseQueryString( urlParser.search.substr( 1 ) ),
+ { changeset_uuid: changesetUuid }
+ ) );
+ history.replaceState( { customize: urlParser.href }, '', urlParser.href );
+ } );
+ }
+