Commit 8737150 1 parent e962ef9 commit 8737150 Copy full SHA for 8737150
File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,11 @@ const ipc = global.require('electron').ipcRenderer
15
15
const UrlBarSuggestions = require ( './urlBarSuggestions.js' )
16
16
const messages = require ( '../constants/messages' )
17
17
const dragTypes = require ( '../constants/dragTypes' )
18
+ const { getSetting } = require ( '../settings' )
19
+ const settings = require ( '../constants/settings' )
18
20
const contextMenus = require ( '../contextMenus' )
19
21
const dndData = require ( '../dndData' )
22
+ const appStoreRenderer = require ( '../stores/appStoreRenderer' )
20
23
21
24
const { isUrl, isIntermediateAboutPage } = require ( '../lib/appUrlUtil' )
22
25
@@ -265,12 +268,18 @@ class UrlBar extends ImmutableComponent {
265
268
}
266
269
}
267
270
268
- const location = this . props . urlbar . get ( 'location' )
271
+ let location = this . props . urlbar . get ( 'location' )
269
272
const history = this . props . activeFrameProps . get ( 'history' )
270
273
if ( isIntermediateAboutPage ( location ) && history . size > 0 ) {
271
274
return history . last ( )
272
275
}
273
276
277
+ // We can extend the conditions if there are more chrome-extension to
278
+ // truncate
279
+ if ( getSetting ( settings . PDFJS_ENABLED ) && location . startsWith ( appStoreRenderer . state . get ( 'pdfjsOrigin' ) ) ) {
280
+ location = location . replace ( / ^ c h r o m e - e x t e n s i o n : \/ \/ .+ \/ ( \w + : \/ \/ .+ ) / , '$1' )
281
+ }
282
+
274
283
return [ 'about:blank' , 'about:newtab' ] . includes ( this . props . urlbar . get ( 'location' ) )
275
284
? '' : location
276
285
}
You can’t perform that action at this time.
0 commit comments