Skip to content

Commit

Permalink
Merge pull request #305 from pyronaur/patch-1
Browse files Browse the repository at this point in the history
interceptedRequest.url should be a function call
  • Loading branch information
pocketjoso authored Aug 17, 2020
2 parents e61253e + 044670b commit e9eccf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const PAGE_UNLOADED_DURING_EXECUTION_ERROR_MESSAGE =
'PAGE_UNLOADED_DURING_EXECUTION: Critical css generation script could not be executed.\n\nThis can happen if Penthouse was killed during execution, OR otherwise most commonly if the page navigates away after load, via setting window.location, meta tag refresh directive or similar. For the critical css generation to work the loaded page must stay: remove any redirects or move them to the server. You can also disable them on your end just for the critical css generation, for example via a query parameter.'

function blockinterceptedRequests (interceptedRequest) {
const isJsRequest = /\.js(\?.*)?$/.test(interceptedRequest.url)
const isJsRequest = /\.js(\?.*)?$/.test(interceptedRequest.url())
if (isJsRequest) {
interceptedRequest.abort()
} else {
Expand Down

0 comments on commit e9eccf9

Please sign in to comment.