EpubScriptPolicy

class EpubScriptPolicy(val enabled: Boolean = true, val budgetMillis: Long, val instructionBudget: Int = 0)(source)

What a book's scripts are allowed to do, and for how long (#41).

A script inside an EPUB is input from whoever made the file. The defaults are the careful ones: scripts run, and each thing the reader does, opening a chapter, a tap, a round of timers, may keep them busy for five seconds before the engine stops them.

Constructors

Link copied to clipboard
constructor(enabled: Boolean = true, budgetMillis: Long, instructionBudget: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

How long one call may run before the engine stops it. Zero means no limit. The DOM the library sets up in a chapter's engine before the book's first script does not count (#554).

Link copied to clipboard

Whether the book's scripts run at all. False makes every call a no-op.

Link copied to clipboard

Interpreter steps one engine call may take, as a second line of defence for a loop that never asks the clock. Zero means the clock is the only limit.