File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/scramjet/packages/core/src/client/dom Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,10 @@ export default function (client: ScramjetClient, self: typeof window) {
290290 client . Trap ( "Element.prototype.innerHTML" , {
291291 set ( ctx , value : string ) {
292292 let newval ;
293- if ( ctx . this instanceof self . HTMLScriptElement ) {
293+ if (
294+ ctx . this instanceof self . HTMLScriptElement &&
295+ / ( a p p l i c a t i o n | t e x t ) \/ j a v a s c r i p t | m o d u l e | u n d e f i n e d / . test ( ctx . this . type )
296+ ) {
294297 newval = rewriteJs ( value , "(anonymous script element)" , client . meta ) ;
295298 client . natives . call (
296299 "Element.prototype.setAttribute" ,
@@ -335,7 +338,10 @@ export default function (client: ScramjetClient, self: typeof window) {
335338 client . Trap ( "Node.prototype.textContent" , {
336339 set ( ctx , value : string ) {
337340 // TODO: box the instanceofs
338- if ( ctx . this instanceof self . HTMLScriptElement ) {
341+ if (
342+ ctx . this instanceof self . HTMLScriptElement &&
343+ / ( a p p l i c a t i o n | t e x t ) \/ j a v a s c r i p t | m o d u l e | u n d e f i n e d / . test ( ctx . this . type )
344+ ) {
339345 const newval : string = rewriteJs (
340346 value ,
341347 "(anonymous script element)" ,
You can’t perform that action at this time.
0 commit comments