@@ -23,19 +23,19 @@ const make_widget = ({domain}) => {
2323 attr . href = chrome . extension . getURL ( "css/iframe.css" )
2424 return attr
2525 }
26- $ ( "head" ) . append ( $ ( '<link>' ) . attr ( add_link ( codesy . css . attr ) ) ) ;
27- const endtimer = ( ) => console . timeEnd ( 'codesy append iframe' ) ;
2826 const add_src = ( url , attr ) => {
2927 attr . src = `${ domain } /bid-status/?${ $ . param ( { url} ) } `
3028 return attr
3129 }
30+ const endtimer = ( ) => console . timeEnd ( 'codesy append iframe' ) ;
31+ $link = ( ) => $ ( "head" ) . append ( $ ( '<link>' ) . attr ( add_link ( codesy . css . attr ) ) ) ;
3232 $iframe = ( new_url ) => $ ( '<iframe>' ) . attr ( add_src ( new_url , codesy . iframe . attr ) )
3333 const add = ( new_url ) => {
3434 console . time ( 'codesy append iframe' ) ;
35- $ ( 'body' ) . append ( $iframe ( new_url ) ) . ready ( add_link ) . ready ( endtimer )
35+ $ ( 'body' ) . append ( $iframe ( new_url ) ) . ready ( $link ) . ready ( endtimer )
3636 }
3737 const remove = ( ) => $ ( `#${ codesy . iframe . attr . id } ` ) . remove ( ) ;
38- resolve ( { url :'' , add, remove } )
38+ resolve ( { url : '' , add, remove } )
3939 } )
4040}
4141
@@ -55,10 +55,12 @@ const watch_the_href = (widget) => {
5555 } ) ;
5656} ;
5757
58+ page_reload = ( ) => window . location . reload ( true ) ;
59+
5860const get_codesy_domain = ( ) => {
5961 return new Promise ( ( resolve ) => {
6062 chrome . storage . local . get ( null , resolve )
61- chrome . storage . onChanged . addListener ( window . location . reload )
63+ chrome . storage . onChanged . addListener ( page_reload )
6264 } ) ;
6365}
6466
0 commit comments