Domains Accessibility Animation ApplicationCache CSS CacheStorage Console DOM DOMDebugger DOMStorage Database Debugger DeviceOrientation Emulation FileSystem HeapProfiler IndexedDB Input Inspector LayerTree Memory Network Page Power Profiler Rendering Runtime ScreenOrientation Security ServiceWorker Timeline Tracing Worker
Chrome Debugger Protocol Viewer

FileSystem Domain

Methods

enable

Enables events from backend.

disable

Disables events from backend.

requestFileSystemRoot

Returns root directory of the FileSystem, if exists.

Parameters
origin
string Security origin of requesting FileSystem. One of frames in current page needs to have this security origin.
type
string FileSystem type of requesting FileSystem. Allowed values: temporary, persistent.
Return object
errorCode
integer 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.
root
Entry Contains root of the requested FileSystem if the command completed successfully.

requestDirectoryContent

Returns content of the directory.

Parameters
url
string URL of the directory that the frontend is requesting to read from.
Return object
errorCode
integer 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.
entries
array [ Entry ] Contains all entries on directory if the command completed successfully.

requestMetadata

Returns metadata of the entry.

Parameters
url
string URL of the entry that the frontend is requesting to get metadata from.
Return object
errorCode
integer 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.
metadata
Metadata Contains metadata of the entry if the command completed successfully.

requestFileContent

Returns content of the file. Result should be sliced into [start, end).

Parameters
url
string URL of the file that the frontend is requesting to read from.
readAsText
boolean True if the content should be read as text, otherwise the result will be returned as base64 encoded text.
start
integer Specifies the start of range to read.
end
integer Specifies the end of range to read exclusively.
charset
string Overrides charset of the content when content is served as text.
Return object
errorCode
integer 0, if no error. Otherwise, errorCode is set to FileError::ErrorCode value.
content
string Content of the file.
charset
string Charset of the content if it is served as text.

deleteEntry

Deletes specified entry. If the entry is a directory, the agent deletes children recursively.

Parameters
url
string URL of the entry to delete.
Return object
errorCode
integer 0, if no error. Otherwise errorCode is set to FileError::ErrorCode value.

Types

Entry

Represents a browser side file or directory.

Type: object

Properties
url
string filesystem: URL for the entry.
name
string The name of the file or directory.
isDirectory
boolean True if the entry is a directory.
mimeType
string MIME type of the entry, available for a file only.
resourceType
Page.ResourceType ResourceType of the entry, available for a file only.
isTextFile
boolean True if the entry is a text file.

Metadata

Represents metadata of a file or entry.

Type: object

Properties
modificationTime
number Modification time.
size
number File size. This field is always zero for directories.