Socket
Socket
Sign inDemoInstall

mobile-console-lite

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mobile-console-lite

A console emulator for debugging on mobile and tablet


Version published
Weekly downloads
90
decreased by-20.35%
Maintainers
1
Install size
171 kB
Created
Weekly downloads
 

Readme

Source

MobileConsoleLite

CircleCI Status npm npm npm

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 = {
	//some 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"
	}
})
//will start on https://www.example.com/#name


query will start the console if the hash #name is present in url

new MCL(document.querySelector("#app"), {
	initOn: {
		query: "name"
	}
})
//will start on https://www.example.com/?name=value



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

  • eval des commandes
  • toggle de la console window
  • resize de la console window
  • drag de la console window
  • init class on hash or query param
  • add style param for customising console
  • customising console catcher (log/error/warn)
  • catching console.warn
  • catching console.time
  • catching console.table
  • css bundles into one single file
  • or test css in js
  • doc
  • TU
  • TS

Keywords

FAQs

Last updated on 18 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc