Wrapper_JSDataUrl

Wrapper_JSDataUrl

Represent a javascript payload in data: url format

Members

Methods

Extends

Methods

script() → {Wrapper_HTML}

Transform any javascript data url into a <script src> payload.

Example
const p = Payload.new().eval(() => alert(1))
const w = Wrapper.new().dataUrl().script()

const i = document.createElement('iframe')
s.srcdoc = w.wrap(p)
document.body.appendChild(i)
Returns
Type
Wrapper_HTML

scriptImport() → {Wrapper_HTML}

Transform any javascript data url into a <script src> import payload.

Example
const p = Payload.new().eval(() => alert(1))
const w = Wrapper.new().dataUrl().scriptImport()

const i = document.createElement('iframe')
s.srcdoc = w.wrap(p)
document.body.appendChild(i)
Returns
Type
Wrapper_HTML

wrap(payload) → {string}

Wrap a payload or a string and return it a as string

Example
const p = Payload.new().eval(() => alert(1))
const w = Wrapper.new()
const code = w.wrap(p)

eval(code)
Inherited From:
Parameters
Name Type Description
payload Payload | String

Payload to wrap

Returns
Type
string