提供給特定公司的webview plugin
- 每一次touch都會回傳點選時間
- 回傳格式:{"type":"touch","lastTouchTime": @millsecond@ }
@millsecond@ 是使用者按下時機的絕對時間
InvestmentWebView.addEventListener('touch', successCallback, errorCallback) function successCallback(object){ console.log(object.lastTouchTime) // 1534412 } function errorCallback(object){ console.log(object) // android/ios error message }
- 攔截網頁中的button click, 並回傳html ID
- 回傳格式:{"type":"buttonclick","id": @buttonid@ }
@buttonid@ 是使用者按下的button id
InvestmentWebView.addEventListener('buttonclick', successCallback, errorCallback) function successCallback(object){ console.log(object.id) // CloseBtn009 } function errorCallback(object){ console.log(object) // android/ios error message }
- 切換網頁都會回傳網址
- 回傳格式:{"type":"loadstart","url": @url@ }
@url@ 是切換後的目的網址
InvestmentWebView.addEventListener('loadstart', successCallback, errorCallback) function successCallback(object){ console.log(object.url) // https://www.google.com } function errorCallback(object){ console.log(object) // android/ios error message }
- 支援從cordova上層直接關閉webview
InvestmentWebView.close()
- 開啟網址
title(string): 手機上webview標題文字
url(string): 網址
type(int): 特定說明文件
noteButtonString(string): 說明按鈕要顯示給用戶的文字
InvestmentWebView.openWeb(title, url, type, noteButtonString)