@@ -36,6 +36,7 @@ const logger = self.logger = { ownerId: Date.now() };
3636const logDate = new Date ( ) ;
3737const logDateTimezoneOffset = logDate . getTimezoneOffset ( ) * 60 ;
3838const loggerEntries = [ ] ;
39+ let loggerEntryIdGenerator = 1 ;
3940
4041const COLUMN_TIMESTAMP = 0 ;
4142const COLUMN_FILTER = 1 ;
@@ -319,13 +320,11 @@ const LogEntry = function(details) {
319320 if ( details instanceof Object === false ) { return ; }
320321 const receiver = LogEntry . prototype ;
321322 for ( const prop in receiver ) {
322- if (
323- details . hasOwnProperty ( prop ) &&
324- details [ prop ] !== receiver [ prop ]
325- ) {
326- this [ prop ] = details [ prop ] ;
327- }
323+ if ( details . hasOwnProperty ( prop ) === false ) { continue ; }
324+ if ( details [ prop ] === receiver [ prop ] ) { continue ; }
325+ this [ prop ] = details [ prop ] ;
328326 }
327+ this . id = `${ loggerEntryIdGenerator ++ } ` ;
329328 if ( details . aliasURL !== undefined ) {
330329 this . aliased = true ;
331330 }
@@ -346,7 +345,6 @@ LogEntry.prototype = {
346345 docHostname : '' ,
347346 domain : '' ,
348347 filter : undefined ,
349- id : '' ,
350348 method : '' ,
351349 realm : '' ,
352350 tabDomain : '' ,
@@ -1627,9 +1625,10 @@ dom.on(document, 'keydown', ev => {
16271625 const aliasURLFromID = function ( id ) {
16281626 if ( id === '' ) { return '' ; }
16291627 for ( const entry of loggerEntries ) {
1630- if ( entry . id !== id || entry . aliased ) { continue ; }
1631- const fields = entry . textContent . split ( '\x1F' ) ;
1632- return fields [ COLUMN_URL ] || '' ;
1628+ if ( entry . id !== id ) { continue ; }
1629+ const match = / \b a l i a s U R L = ( [ ^ \x1F ] + ) / . exec ( entry . textContent ) ;
1630+ if ( match === null ) { return '' ; }
1631+ return match [ 1 ] ;
16331632 }
16341633 return '' ;
16351634 } ;
0 commit comments