Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
thqby committed May 10, 2023
1 parent e48816c commit 6c56def
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Chrome.ahk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/************************************************************************
* @description: Modify from G33kDude's Chrome.ahk v1
* @author thqby
* @date 2023/04/02
* @version 1.0.3
* @date 2023/05/10
* @version 1.0.4
***********************************************************************/
class Chrome {
Expand Down Expand Up @@ -106,11 +106,11 @@ class Chrome {
return Pages
}

NewPage(url := 'about:blank') {
NewPage(url := 'about:blank', fnCallback?) {
http := Chrome._http
http.Open('PUT', 'http://127.0.0.1:' this.DebugPort '/json/new?' url), http.Send()
if ((PageData := JSON.parse(http.responseText)).Has('webSocketDebuggerUrl'))
return Chrome.Page(StrReplace(PageData['webSocketDebuggerUrl'], 'localhost', '127.0.0.1'), http)
return Chrome.Page(StrReplace(PageData['webSocketDebuggerUrl'], 'localhost', '127.0.0.1'), fnCallback?)
}

ClosePage(opts, MatchMode := 'exact') {
Expand Down

0 comments on commit 6c56def

Please sign in to comment.