Skip to content

Commit

Permalink
fix(pwa): disable frontend request proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredrethman committed May 28, 2024
1 parent b22b1c3 commit 04bfd05
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions includes/class-pwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Newspack;

use WP_Error;
use WP_Service_Worker_Scripts;

defined( 'ABSPATH' ) || exit;

Expand All @@ -25,6 +26,19 @@ public static function init() {

add_filter( 'wp_service_worker_navigation_caching', [ __CLASS__, 'increase_network_timeout' ] );
add_filter( 'wp_service_worker_error_messages', [ __CLASS__, 'error_messages' ] );

/**
* Temporary workaround to disable the offline post request handling script.
*
* @see - https://github.com/GoogleChromeLabs/pwa-wp/issues/1106
*/
add_action(
'wp_front_service_worker',
function ( WP_Service_Worker_Scripts $scripts ) {
unset( $scripts->registered['wp-offline-post-request-handling'] );
},
100
);
}

/**
Expand Down

0 comments on commit 04bfd05

Please sign in to comment.