Element that support communication with the api-console-extension. It is used in API Console project.
npm install --save @api-components/api-console-ext-comm
import { LitElement, html } from 'lit-element';
import '@api-components/api-console-ext-comm/api-console-ext-comm.js';
class SampleElement extends PolymerElement {
render() {
return html`
<api-console-ext-comm
@hasextension-changed="${this._extensionDetectedHandler}"></api-console-ext-comm>
`;
}
_extensionDetectedHandler(e) {
console.log('The browser has API console extension');
}
}
customElements.define('sample-element', SampleElement);
git clone https://github.com/advanced-rest-client/api-console-ext-comm
cd api-console-ext-comm
npm install
npm start
npm test