File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
scramjet/packages/core/rewriter/js/src Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -487,7 +487,6 @@ const methods = {
487487
488488 const fetchresponse = await controller . fetchHandler . handleFetch ( data ) ;
489489
490- console . log ( fetchresponse . headers ) ;
491490 if (
492491 isDownload ( fetchresponse . headers , data . destination ) &&
493492 fetchresponse . status === 200
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ setConfig({
4141 scramitize : false ,
4242 sourcemaps : true ,
4343 destructureRewrites : true ,
44- interceptDownloads : false ,
4544 allowInvalidJs : false ,
4645 allowFailedIntercepts : false ,
4746 antiAntiDebugger : false ,
Original file line number Diff line number Diff line change @@ -470,9 +470,12 @@ where
470470 // however this code only exists because of recaptcha whatever
471471 // and it would slow down js execution a lot
472472 if s. property . name == "postMessage" {
473+ // include the "postMessage" and the dot before it in the inner span
474+ // if `postMessage?.` remove the dot and the question mark
475+ let offset = if s. optional { 1 } else { 2 } ;
476+
473477 self . jschanges . add ( rewrite ! ( s. span, WrapPostMessage {
474- // include the "postMessage" and the dot before it (-1)
475- inner: Span :: new( s. property. span. start - 1 , s. property. span. end) ,
478+ inner: Span :: new( s. property. span. start - offset, s. property. span. end) ,
476479 } ) ) ;
477480
478481 // walk::walk_expression(self, &s.object);
You can’t perform that action at this time.
0 commit comments