PhantomJS - offlineStoragePath Property



This property returns the path where the data is stored using the window.localStorage. This path can be changed using --local-storage-path from the command line.

Syntax

Its syntax is as follows −

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

Example

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

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

The above program generates the following output.

C:/Users/Username/AppData/Local/Ofi Labs/PhantomJS
phantomjs_webpage_module_properties.htm
Advertisements