@@ -110,13 +110,21 @@ const mutations = {
110
110
state . pages [ payload . pageIndex ] . canRefresh = true ;
111
111
} ,
112
112
[ types . DID_STOP_LOADING ] ( state , payload ) {
113
+ const regexp = new RegExp ( '^lulumi(-extension)?://.+$' ) ;
113
114
const url = payload . webview . getURL ( ) ;
114
115
state . pages [ payload . pageIndex ] . location = decodeURIComponent ( url ) ;
115
- if ( url . startsWith ( config . lulumiPagesCustomProtocol ) ) {
116
- const guestUrl = require ( 'url' ) . parse ( url ) ;
117
- const guestHash = guestUrl . hash . substr ( 2 ) ;
118
- state . pages [ payload . pageIndex ] . title = `${ guestUrl . host } : ${ guestHash === '' ? 'about' : guestHash } ` ;
119
- state . pages [ payload . pageIndex ] . location = decodeURIComponent ( url ) ;
116
+ if ( url . match ( regexp ) ) {
117
+ if ( url . match ( regexp ) [ 1 ] === undefined ) {
118
+ const guestUrl = require ( 'url' ) . parse ( url ) ;
119
+ const guestHash = guestUrl . hash . substr ( 2 ) ;
120
+ state . pages [ payload . pageIndex ] . title = `${ guestUrl . host } : ${ guestHash === '' ? 'about' : guestHash } ` ;
121
+ state . pages [ payload . pageIndex ] . location = decodeURIComponent ( url ) ;
122
+ } else {
123
+ state . pages [ payload . pageIndex ] . statusText = false ;
124
+ state . pages [ payload . pageIndex ] . canGoBack = payload . webview . canGoBack ( ) ;
125
+ state . pages [ payload . pageIndex ] . canGoForward = payload . webview . canGoForward ( ) ;
126
+ state . pages [ payload . pageIndex ] . isLoading = false ;
127
+ }
120
128
state . pages [ payload . pageIndex ] . favicon = config . tabConfig . lulumiFavicon ;
121
129
} else {
122
130
if ( ! state . pages [ payload . pageIndex ] . title ) {
@@ -125,6 +133,7 @@ const mutations = {
125
133
if ( ! state . pages [ payload . pageIndex ] . favicon ) {
126
134
state . pages [ payload . pageIndex ] . favicon = config . tabConfig . defaultFavicon ;
127
135
}
136
+ // history
128
137
if ( state . pages [ payload . pageIndex ] . title !== 'error' ) {
129
138
if ( state . history . length !== 0 ) {
130
139
if ( state . history [ state . history . length - 1 ] . url
0 commit comments