bool InjectJavaScript(string, string, bool, KioBrowserWndType, KioBrowserType)
Injects JavaScript into the selected browsers
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
js |
string The JavaScript to inject into the selected browsers. |
brNameId |
(Optional) string Name of docked browser/toolbar (from CT) or Popup name (from window.open). If null, everything matches. This can also be the browser GUID (KioInfo.BrowserGuid and UniqueId in addin code). |
includeAllFrames |
(Optional) bool true to inject the JavaScript into all frames. |
wndType |
(Optional) KioBrowserWndType
Type of window to inject into. This can be a set of flags that are OR'd together to target multiple types. If this parameter is not specified, the default selection will be the main window, all popups and tabs, and the additional displays (KioBrowserWndType.Main|KioBrowserWndType.Popup|KioBrowserWndType.Secondary). |
brType |
(Optional) KioBrowserType
Type of browser to inject into. This can be a set of flags that are OR'd together to target multiple types. If this parameter is not specified, all browser types will be selected (KioBrowserType.All). |
Return
True, if code was injected into any browser/frame. False otherwise.
Remarks
Injects JavaScript into almost every browser of KioWare by default. Optional parameters may be configured to inject into less, more, and even all; including all frames.
Examples
var KioBrowserType = {
Main: 1,
Secondary: 2,
Keyboard: 4,
Popup: 8,
MediaCapture: 16,
DriveBrowser: 32
}
var KioBrowserType = {
All: -1,
Normal: 1,
Docked: 2,
Toolbar: 4
}
KioApp.InjectJavaScript('window.location="https://www.google.com/?q=KioWare";', null, false,
KioBrowserWndType.Main|KioBrowserWndType.Popup, KioBrowserType.All);
Requirements
KioWare for Windows version 8.1 or greater.