From 8b829101ff5a615eebc4e8a7af0f37ece9665057 Mon Sep 17 00:00:00 2001 From: Attila Vago <6254855+attilavago@users.noreply.github.com> Date: Sun, 25 Feb 2018 23:12:16 +0000 Subject: [PATCH 1/2] insertCSS example update The current example in the docs is incomplete and thus quite useless. Just on its own won't manipulate the CSS of a loaded page. It requires the InAppBrowserEvent, and using it in the callback. --- src/@ionic-native/plugins/in-app-browser/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/@ionic-native/plugins/in-app-browser/index.ts b/src/@ionic-native/plugins/in-app-browser/index.ts index d4e0a1bfc..b029b5f9e 100644 --- a/src/@ionic-native/plugins/in-app-browser/index.ts +++ b/src/@ionic-native/plugins/in-app-browser/index.ts @@ -155,7 +155,7 @@ export class InAppBrowserObject { * @description Launches in app Browser * @usage * ```typescript - * import { InAppBrowser } from '@ionic-native/in-app-browser'; + * import { InAppBrowser, InAppBrowserEvent } from '@ionic-native/in-app-browser'; * * constructor(private iab: InAppBrowser) { } * @@ -166,7 +166,12 @@ export class InAppBrowserObject { * const browser = this.iab.create('https://ionicframework.com/'); * * browser.executeScript(...); + * * browser.insertCSS(...); + * browser.on('loadstop').subscribe((event: InAppBrowserEvent) => { + * browser.insertCSS({ code: "body{color: red;" }); + * }); + * * browser.close(); * * ``` From 3841219dd54363ecaf17658401f8292c331eb94c Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 17 Mar 2018 01:03:46 +0100 Subject: [PATCH 2/2] Update index.ts --- src/@ionic-native/plugins/in-app-browser/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/in-app-browser/index.ts b/src/@ionic-native/plugins/in-app-browser/index.ts index b029b5f9e..6310d888f 100644 --- a/src/@ionic-native/plugins/in-app-browser/index.ts +++ b/src/@ionic-native/plugins/in-app-browser/index.ts @@ -155,7 +155,7 @@ export class InAppBrowserObject { * @description Launches in app Browser * @usage * ```typescript - * import { InAppBrowser, InAppBrowserEvent } from '@ionic-native/in-app-browser'; + * import { InAppBrowser } from '@ionic-native/in-app-browser'; * * constructor(private iab: InAppBrowser) { } * @@ -168,7 +168,7 @@ export class InAppBrowserObject { * browser.executeScript(...); * * browser.insertCSS(...); - * browser.on('loadstop').subscribe((event: InAppBrowserEvent) => { + * browser.on('loadstop').subscribe(event => { * browser.insertCSS({ code: "body{color: red;" }); * }); *