From b94882533aad24ca4c531a1fdab6734006dd7b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0ulek?= Date: Mon, 23 Jan 2017 18:24:33 +0100 Subject: [PATCH 1/2] added props and events aligned with latest electron version 1.4.8 --- src/webview.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/webview.js b/src/webview.js index 61529ef..e7da83f 100644 --- a/src/webview.js +++ b/src/webview.js @@ -12,18 +12,29 @@ const EVENTS = [ 'did-get-response-details', 'did-get-redirect-request', 'dom-ready', - 'page-title-set', + 'page-title-updated', 'page-favicon-updated', 'enter-html-full-screen', 'leave-html-full-screen', 'console-message', + 'found-in-page', 'new-window', + 'will-navigate', + 'did-navigate', + 'did-navigate-in-page', 'close', 'ipc-message', 'crashed', 'gpu-crashed', 'plugin-crashed', - 'destroyed' + 'destroyed', + 'media-started-playing', + 'media-paused', + 'did-change-theme-color', + 'update-target-url', + 'devtools-opened', + 'devtools-closed', + 'devtools-focused' ]; const HANDLERS = EVENTS.map(event => camelCase(`on-${event}`)); @@ -76,7 +87,7 @@ export default class WebView extends React.Component { } const tagPropTypes = { - autosize: React.PropTypes.bool, + autosize: React.PropTypes.string, disablewebsecurity: React.PropTypes.bool, httpreferrer: React.PropTypes.string, nodeintegration: React.PropTypes.bool, @@ -90,6 +101,10 @@ const tagPropTypes = { blinkfeatures: React.PropTypes.string, disableblinkfeatures: React.PropTypes.string, guestinstance: React.PropTypes.string, + minwidth: React.PropTypes.string, + minheight: React.PropTypes.string, + maxwidth: React.PropTypes.string, + maxheight: React.PropTypes.string }; const eventPropTypes = EVENTS_HANDLERS.reduce((propTypes, { event, handler }) => { From 1ff43661fef6fdcda23b43777d96403af2408c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0ulek?= Date: Mon, 23 Jan 2017 19:05:59 +0100 Subject: [PATCH 2/2] updated typescript def --- index.d.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index 3e62305..f0daae3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -4,8 +4,12 @@ import { Component } from 'react'; export interface WebViewProps extends React.HTMLAttributes, React.ClassAttributes { src: string - - autosize?: boolean + + autosize?: string; + minwidth?: string; + minheight?: string; + maxwidth?: string; + maxheight?: string; disablewebsecurity?: boolean httpreferrer?: string nodeintegration?: boolean @@ -18,7 +22,7 @@ export interface WebViewProps extends React.HTMLAttributes {} +export default class WebView extends Component {}