MobileConsoleLite
Console emulator help you for debugging on mobile and tablet device.
MobileConsoleLite
create a DOM console catching the console.log and window error.
Installation
$ npm install mobile-console-lite
//or
$ yarn add mobile-console-lite
Importing
We recommand calling the script at the very top of the <head>
of your page to be sure catching every error/log.
import MCL from "mobile-console-lite"
new MCL()
CDN
<script type="text/javascript" src="path/to/dist/mcl.js"></script>
<script type="text/javascript">
new MCL()
</script>
Quick use
import MCL from "mobile-console-lite"
new MCL()
Will create the console at the end of body tag.
You also can specify the console container by passing a node selector in the first argument.
example :
new MCL(document.querySelector("#app"))
customising
you can pass an options
object for customising the console
import MCL from "mobile-console-lite"
const options = {
}
new MCL(document.querySelector("#app"), options)
options
You can set conditions for launching the console.
hash
will start the console if the hash #name
is present in url
new MCL(document.querySelector("#app"), {
initOn: {
hash: "name"
}
})
query
will start the console if the hash #name
is present in url
new MCL(document.querySelector("#app"), {
initOn: {
query: "name"
}
})
You also can set the default display of console
minimize : boolean
default : false
new MCL(document.querySelector("#app"), {
display: {
minimize: true
}
})
by default the console will be minimize
popup : boolean
default : false
new MCL(document.querySelector("#app"), {
display: {
popup: true
}
})
by default the console will be popuped
TODO