fix: webContents.navigationHistory should be enumerable (#42139)
		
	fix: webContents.navigationHistory should be enumerable
This commit is contained in:
		
					parent
					
						
							
								1ef5406c8c
							
						
					
				
			
			
				commit
				
					
						d0cb298f95
					
				
			
		
					 2 changed files with 13 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -541,7 +541,8 @@ WebContents.prototype._init = function () {
 | 
			
		|||
      length: this._historyLength.bind(this),
 | 
			
		||||
      getEntryAtIndex: this._getNavigationEntryAtIndex.bind(this)
 | 
			
		||||
    },
 | 
			
		||||
    writable: false
 | 
			
		||||
    writable: false,
 | 
			
		||||
    enumerable: true
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  // Dispatch IPC messages to the ipc module.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,17 @@ describe('webContents module', () => {
 | 
			
		|||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  describe('webContents properties', () => {
 | 
			
		||||
    afterEach(closeAllWindows);
 | 
			
		||||
 | 
			
		||||
    it('has expected additional enumerable properties', () => {
 | 
			
		||||
      const w = new BrowserWindow({ show: false });
 | 
			
		||||
      const properties = Object.getOwnPropertyNames(w.webContents);
 | 
			
		||||
      expect(properties).to.include('ipc');
 | 
			
		||||
      expect(properties).to.include('navigationHistory');
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  describe('fromId()', () => {
 | 
			
		||||
    it('returns undefined for an unknown id', () => {
 | 
			
		||||
      expect(webContents.fromId(12345)).to.be.undefined();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue