scripts
Type:
<string> | <string[]>
- CLI
- JavaScript
- Shell
- Python
- Ruby
const mql = require('@microlink/mql')
const { status, data } = await mql('https://microlink.io', {
screenshot: true,
scripts: [
'%5B%5D.forEach.call(document.querySelectorAll(%22*%22)%2Cfunction(a)%7Ba.style.outline%3D%221px%20solid%20%23%22%2B(~~(Math.random()*(1%3C%3C24))).toString(16)%7D)'
]
})
mql.render(data)
The code to be injected can be defined as:
- Inline code (e.g.,
"document.body.style.backgroundColor = 'red'"
). - Absolute URLs (e.g.,
'https://cdn.jsdelivr.net/npm/@microlink/[email protected]/src/browser.js'
).
Prefer to use modules whenever possible.