File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11import { rewriteUrl } from "../../shared" ;
22import { ScramjetClient } from "../client" ;
3- import { SCRAMJETCLIENT } from "../../symbols" ;
3+ import {
4+ SCRAMJETCLIENT ,
5+ SCRAMJETCLIENTNAME ,
6+ SCRAMJETFRAMENAME ,
7+ } from "../../symbols" ;
48
59export default function ( client : ScramjetClient ) {
610 client . Proxy ( "window.open" , {
711 apply ( ctx ) {
812 if ( ctx . args [ 0 ] ) ctx . args [ 0 ] = rewriteUrl ( ctx . args [ 0 ] , client . meta ) ;
913
1014 if ( [ "_parent" , "_top" , "_unfencedTop" ] . includes ( ctx . args [ 1 ] ) )
11- ctx . args [ 1 ] = "_self" ;
15+ ctx . args [ 1 ] = SCRAMJETFRAMENAME ; // TODO: this is still technically the wrong behavior
1216
1317 const realwin = ctx . call ( ) ;
1418
Original file line number Diff line number Diff line change 11import { ScramjetController } from "." ;
22import type { ScramjetClient } from "../client/client" ;
3- import { SCRAMJETCLIENT , SCRAMJETFRAME } from "../symbols" ;
3+ import { SCRAMJETCLIENT , SCRAMJETFRAME , SCRAMJETFRAMENAME } from "../symbols" ;
44
55export class ScramjetFrame extends EventTarget {
66 constructor (
77 private controller : ScramjetController ,
88 public frame : HTMLIFrameElement
99 ) {
1010 super ( ) ;
11+ frame . name = SCRAMJETFRAMENAME ;
1112 frame [ SCRAMJETFRAME ] = this ;
1213 }
1314
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { CookieStore } from "../cookie";
88import { unrewriteBlob } from "../../shared/rewriters/url" ;
99import { $scramjet } from "../../scramjet" ;
1010import { getRewriter } from "./wasm" ;
11+ import { SCRAMJETCLIENTNAME , SCRAMJETFRAMENAME } from "../../symbols" ;
1112
1213const encoder = new TextEncoder ( ) ;
1314function rewriteHtmlInner (
@@ -231,7 +232,8 @@ export const htmlRules: {
231232 } ,
232233 {
233234 fn : ( value : string ) => {
234- if ( [ "_parent" , "_top" , "_unfencedTop" ] . includes ( value ) ) return "_self" ;
235+ if ( [ "_parent" , "_top" , "_unfencedTop" ] . includes ( value ) )
236+ return SCRAMJETFRAMENAME ; // TODO: ...
235237 else return value ;
236238 } ,
237239 target : [ "a" , "base" ] ,
Original file line number Diff line number Diff line change 22export const SCRAMJETCLIENTNAME = "scramjet client global" ;
33export const SCRAMJETCLIENT = Symbol . for ( SCRAMJETCLIENTNAME ) ;
44export const SCRAMJETFRAME = Symbol . for ( "scramjet frame handle" ) ;
5+ export const SCRAMJETFRAMENAME = "scramjet_frame" ;
You can’t perform that action at this time.
0 commit comments