@@ -77,8 +77,8 @@ function shouldDebug(details) {
7777/******************************************************************************/
7878
7979builtinScriptlets . push ( {
80- name : 'abort-current-script-core .fn' ,
81- fn : abortCurrentScriptCore ,
80+ name : 'abort-current-script.fn' ,
81+ fn : abortCurrentScriptFn ,
8282 dependencies : [
8383 'get-exception-token.fn' ,
8484 'safe-self.fn' ,
@@ -87,7 +87,7 @@ builtinScriptlets.push({
8787} ) ;
8888// Issues to mind before changing anything:
8989// https://github.com/uBlockOrigin/uBlock-issues/issues/2154
90- function abortCurrentScriptCore (
90+ function abortCurrentScriptFn (
9191 target = '' ,
9292 needle = '' ,
9393 context = ''
@@ -122,8 +122,9 @@ function abortCurrentScriptCore(
122122 const debug = shouldDebug ( extraArgs ) ;
123123 const exceptionToken = getExceptionTokenFn ( ) ;
124124 const scriptTexts = new WeakMap ( ) ;
125+ const textContentGetter = Object . getOwnPropertyDescriptor ( Node . prototype , 'textContent' ) . get ;
125126 const getScriptText = elem => {
126- let text = elem . textContent ;
127+ let text = textContentGetter . call ( elem ) ;
127128 if ( text . trim ( ) !== '' ) { return text ; }
128129 if ( scriptTexts . has ( elem ) ) { return scriptTexts . get ( elem ) ; }
129130 const [ , mime , content ] =
@@ -596,15 +597,15 @@ builtinScriptlets.push({
596597 ] ,
597598 fn : abortCurrentScript ,
598599 dependencies : [
599- 'abort-current-script-core .fn' ,
600+ 'abort-current-script.fn' ,
600601 'run-at-html-element.fn' ,
601602 ] ,
602603} ) ;
603604// Issues to mind before changing anything:
604605// https://github.com/uBlockOrigin/uBlock-issues/issues/2154
605606function abortCurrentScript ( ...args ) {
606607 runAtHtmlElementFn ( ( ) => {
607- abortCurrentScriptCore ( ...args ) ;
608+ abortCurrentScriptFn ( ...args ) ;
608609 } ) ;
609610}
610611
0 commit comments