PhantomJS - navigationLocked Property



This property checks whether it is allowed to navigate a page or not. If true, it will be on the current page URL and clicking on that page to go to the next page will not be allowed. The default value is false for navigationLocked.

Syntax

Its syntax is as follows −

var wpage = require('webpage').create(); 
wpage.navigationLocked; 

Example

Let us take an example to understand the use of navigationLocked property.

var wpage = require('webpage').create(); 
wpage.open('http://localhost/tasks/page1.html', function (status) {  
   console.log(wpage.navigationLocked);  
   phantom.exit(); 
}); 

It will generate the following output.

False
phantomjs_webpage_module_properties.htm
Advertisements