Skip to content

Commit da9d8b5

Browse files
committed
Update post preview script xpath
1 parent c892176 commit da9d8b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: includes/amp-helper-functions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ function amp_get_content_sanitizers( $post = null ) {
16521652
// Mark the script output by wp_post_preview_js() as being in dev mode.
16531653
if ( is_preview() && get_queried_object() instanceof WP_Post ) {
16541654
$dev_mode_xpaths[] = sprintf(
1655-
'//script[ not( @src ) and contains( text(), "document.location.search" ) and contains( text(), "preview=true" ) and contains( text(), "unload" ) and contains( text(), "window.name" ) and contains( text(), "wp-preview-%d" ) ]',
1655+
'//script[ not( @src ) and contains( text(), "document.location.search" ) and contains( text(), "preview=true" ) and ( contains( text(), "pagehide" ) or contains( text(), "unload" ) ) and contains( text(), "window.name" ) and contains( text(), "wp-preview-%d" ) ]',
16561656
get_queried_object_id()
16571657
);
16581658
}

0 commit comments

Comments
 (0)