EPadLink ePad Vision Bedienungsanleitung Seite 8

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 27
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 7
8 www.epadlink.com
Integration Guide (ePad-vision SDK for Chrome & Firefox)
7.0 Chrome Integration
The Native Messaging Host (NMH) is the critical component of the ePad-vision SDK and Chrome
allows access to NMH in web pages via extensions. Integration into a web page requires a background
extension that acts as a bridge between the web page and the native messaging host application.
The following sections explain installation of NMH, writing extensions for NMH access, installation of
extension, and API access
7.1 Creating an Extension
The first step of the extension is to write the manifest file. Below is the sample manifest.json file of the
ChromeExtension of the SDK.
{
"name": "ePad-vision SDK Chrome Sample Extension",
"version": "1.0",
"manifest_version": 2,
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [{
"matches": ["http://*/*", “<all_urls>"],
"js": ["content.js"]
}],
"permissions" : ["nativeMessaging","activeTab","tabs","<all_urls>"]
}
Parameter
Description
Name
Name of the extension
Version
Version of the extension
Manifest_version
Version of the manifest.
Background
This section specifies the information about the JS file which has the
reference of the extension background JS file. This file will have all the
code for communication with Chrome Native Messaging Host.
Persistent specifies if the extension background js is an event page or
not. Specifying false will make the JavaScript page load when the
specific event happens. We suggest you to keep this the same.
Content_Scripts
This section has information related to the script file which gets injected
into the web page. Content script code registers for an event which web
page raises, and when the event is raised, it invokes the background
script for NMH communication.
The matches attribute specifies the application URLs into which the
content script should be injected.
Js: content java script file.
Permissions
List of permissions the extension requires for communicating with the
device.
Seitenansicht 7
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 26 27

Kommentare zu diesen Handbüchern

Keine Kommentare