File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,14 @@ chrome.runtime.onInstalled.addListener(() => {
22 console . log ( "拡張機能がインストールされました!" ) ;
33} ) ;
44
5+ chrome . runtime . onMessage . addListener ( ( msg ) => {
6+ if ( msg . type === "OPEN_BOOKING" ) {
7+ chrome . tabs . query ( { active : true , currentWindow : true } , ( tabs ) => {
8+ chrome . tabs . update ( tabs [ 0 ] . id , { url : msg . url } ) ;
9+ } ) ;
10+ }
11+ } ) ;
12+
513
614const targetURL = 'https://browser-hack.utcode.net/'
715function isTargetPage ( url ?: string ) : boolean {
Original file line number Diff line number Diff line change @@ -180,7 +180,15 @@ function App() {
180180 < h2 > 最後のミッション</ h2 >
181181 < p > 今までの知識を使って、予約サイトでチケットを先に予約しよう!</ p >
182182 < br > </ br >
183- < a href = "https://browser-hack.utcode.net/reservation/" > 挑戦する</ a >
183+ < button
184+ onClick = { ( ) => {
185+ chrome . runtime . sendMessage ( {
186+ type : "OPEN_BOOKING" ,
187+ url : "https://browser-hack.utcode.net/reservation/"
188+ } ) ;
189+ } } >
190+ 挑戦する
191+ </ button >
184192 < br > </ br >
185193 < p > 上のリンクを押して、とあるイベントの予約サイトに侵入し、一足先にチケットを予約しよう。</ p >
186194 </ div >
You can’t perform that action at this time.
0 commit comments