From 8590e9190dfb9eb1609e7a6f93de2909f6006331 Mon Sep 17 00:00:00 2001 From: Robson Araujo Date: Tue, 11 Jun 2019 14:22:46 -0700 Subject: [PATCH 01/11] Avoid null pointer exception after webview is disposed --- .../flutter_inappbrowser/JavaScriptBridgeInterface.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java index 9f404803c..415fb134e 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/JavaScriptBridgeInterface.java @@ -51,6 +51,10 @@ public void run() { getChannel().invokeMethod("onCallJsHandler", obj, new MethodChannel.Result() { @Override public void success(Object json) { + if (flutterWebView.webView == null) { + // The webview has already been disposed, ignore. + return; + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { flutterWebView.webView.evaluateJavascript("window." + name + "[" + _callHandlerID + "](" + json + "); delete window." + name + "[" + _callHandlerID + "];", null); } From cb79211592deae585a722bd1995e97708e68d29e Mon Sep 17 00:00:00 2001 From: Ben Ulmer Date: Tue, 18 Jun 2019 14:35:40 -0700 Subject: [PATCH 02/11] done --- .../InAppBrowserWebViewController.swift | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/ios/Classes/InAppBrowserWebViewController.swift b/ios/Classes/InAppBrowserWebViewController.swift index a9f187267..fa57355a0 100644 --- a/ios/Classes/InAppBrowserWebViewController.swift +++ b/ios/Classes/InAppBrowserWebViewController.swift @@ -272,27 +272,21 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU weak var weakSelf = self - // Run later to avoid the "took a long time" log message. - DispatchQueue.main.async(execute: {() -> Void in - if (weakSelf?.responds(to: #selector(getter: self.presentingViewController)))! { - weakSelf?.presentingViewController?.dismiss(animated: true, completion: {() -> Void in - self.tmpWindow?.windowLevel = 0.0 - UIApplication.shared.delegate?.window??.makeKeyAndVisible() - if (self.navigationDelegate != nil) { - self.navigationDelegate?.browserExit(uuid: self.uuid) - } - }) - } - else { - weakSelf?.parent?.dismiss(animated: true, completion: {() -> Void in - self.tmpWindow?.windowLevel = 0.0 - UIApplication.shared.delegate?.window??.makeKeyAndVisible() - if (self.navigationDelegate != nil) { - self.navigationDelegate?.browserExit(uuid: self.uuid) - } - }) - } - }) + if (weakSelf?.responds(to: #selector(getter: self.presentingViewController)))! { + weakSelf?.presentingViewController?.dismiss(animated: true, completion: {() -> Void in + self.tmpWindow?.windowLevel = 0.0 + UIApplication.shared.delegate?.window??.makeKeyAndVisible() + }) + } + else { + weakSelf?.parent?.dismiss(animated: true, completion: {() -> Void in + self.tmpWindow?.windowLevel = 0.0 + UIApplication.shared.delegate?.window??.makeKeyAndVisible() + }) + } + if (self.navigationDelegate != nil) { + self.navigationDelegate?.browserExit(uuid: self.uuid) + } } @objc func goBack() { From 39788a016346e1f57a33ec8fe414ed3dbbe10615 Mon Sep 17 00:00:00 2001 From: Paulo Melo Date: Mon, 24 Jun 2019 10:33:14 +0100 Subject: [PATCH 03/11] Android takeScreenshot does not work properly. --- .../InAppWebView/InAppWebView.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java index 1d81944ab..d5b9129d4 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java @@ -298,19 +298,27 @@ public void clearAllCache() { } public byte[] takeScreenshot() { - Picture picture = capturePicture(); + float scale = getScale(); + int height = (int) (getContentHeight() * scale + 0.5); + Bitmap b = Bitmap.createBitmap( getWidth(), - getHeight(), Bitmap.Config.ARGB_8888); + height, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); - picture.draw(c); + draw(c); + int scrollOffset = (getScrollY() + getMeasuredHeight() > b.getHeight()) + ? b.getHeight() : getScrollY(); + Bitmap resized = Bitmap.createBitmap( + b, 0, scrollOffset, b.getWidth(), getMeasuredHeight()); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - b.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); + resized.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); try { byteArrayOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } + resized.recycle(); return byteArrayOutputStream.toByteArray(); } From 81807801dcc1f1c091c9bd933dd0072d71769e44 Mon Sep 17 00:00:00 2001 From: Klingens13 <40038209+Klingens13@users.noreply.github.com> Date: Mon, 19 Aug 2019 16:22:36 +0200 Subject: [PATCH 04/11] Resolving gradle error. This version of flutter_inappbrowser (1.2.1) breaks the gradle build, because the wrong link is set. --- android/src/main/res/menu/menu_main.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/res/menu/menu_main.xml b/android/src/main/res/menu/menu_main.xml index 798214bce..88f44d665 100644 --- a/android/src/main/res/menu/menu_main.xml +++ b/android/src/main/res/menu/menu_main.xml @@ -1,7 +1,7 @@ From 8075117ed31709cad1cca2a74600092ac462b94b Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Tue, 3 Sep 2019 08:31:57 +0200 Subject: [PATCH 05/11] Create BUG_REPORT.md --- ISSUE_TEMPLATE/BUG_REPORT.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ISSUE_TEMPLATE/BUG_REPORT.md diff --git a/ISSUE_TEMPLATE/BUG_REPORT.md b/ISSUE_TEMPLATE/BUG_REPORT.md new file mode 100644 index 000000000..c3f6d96c3 --- /dev/null +++ b/ISSUE_TEMPLATE/BUG_REPORT.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Something is crashing or not working as intended + +--- + +## Environment + +**App version:** +**Android version:** +**Device information:** + +## Description + +**Expected behavior:** + +**Current behavior:** + +## Steps to reproduce + +1. This +2. Than that +3. Then + +## Images + +## Stacktrace/Logcat From a10a0184c8b553a4be7b27ba7bd46d2d34755e05 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Tue, 3 Sep 2019 08:32:14 +0200 Subject: [PATCH 06/11] Create FEATURE_REQUEST.md --- ISSUE_TEMPLATE/FEATURE_REQUEST.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ISSUE_TEMPLATE/FEATURE_REQUEST.md diff --git a/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100644 index 000000000..21c986278 --- /dev/null +++ b/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +## Environment + +**App version:** +**Android version:** +**Device information:** + +## Description + +**What you'd like to happen:** + +**Alternatives you've considered:** + +**Images:** From 8d139a4c33a433c37b0f45142bc05e341001d89c Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Tue, 3 Sep 2019 08:34:13 +0200 Subject: [PATCH 07/11] Create pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..1c48f84c7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +## Connection with issue(s) + +Resolve issue #??? + + + +Connected to #??? + + + +## Testing and Review Notes + + + + +## Screenshots or Videos + + + +## To Do + + +- [ ] double check the original issue to confirm it is fully satisfied +- [ ] add testing notes and screenshots in PR description to help guide reviewers +- [ ] request the "UX" team perform a design review (if/when applicable) From 2fa3eb77558bea03ee4140bb378e15e36006ba67 Mon Sep 17 00:00:00 2001 From: Matias de Andrea Date: Tue, 3 Sep 2019 08:34:26 +0200 Subject: [PATCH 08/11] Move issues reports --- {ISSUE_TEMPLATE => .github/ISSUE_TEMPLATE}/BUG_REPORT.md | 0 {ISSUE_TEMPLATE => .github/ISSUE_TEMPLATE}/FEATURE_REQUEST.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {ISSUE_TEMPLATE => .github/ISSUE_TEMPLATE}/BUG_REPORT.md (100%) rename {ISSUE_TEMPLATE => .github/ISSUE_TEMPLATE}/FEATURE_REQUEST.md (100%) diff --git a/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md similarity index 100% rename from ISSUE_TEMPLATE/BUG_REPORT.md rename to .github/ISSUE_TEMPLATE/BUG_REPORT.md diff --git a/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md similarity index 100% rename from ISSUE_TEMPLATE/FEATURE_REQUEST.md rename to .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md From ebccc4a4c982301809dae437514d485f1ebac02f Mon Sep 17 00:00:00 2001 From: AlexVincent525 Date: Wed, 11 Sep 2019 15:19:25 +0800 Subject: [PATCH 09/11] Fix abstract method error for flutter v1.9.1+hotfix.2 stable. --- .../flutter_inappbrowser/FlutterWebView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java index a2ae78bf1..9092ff080 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/FlutterWebView.java @@ -229,4 +229,11 @@ public void onPageFinished(WebView view, String url) { webView.loadUrl("about:blank"); } } + + @Override + public void onInputConnectionLocked() {} + + @Override + public void onInputConnectionUnlocked() {} + } \ No newline at end of file From 990fe52a484ccc728490d0bdde9273af4745bdbc Mon Sep 17 00:00:00 2001 From: AlexVincent525 Date: Wed, 11 Sep 2019 15:27:56 +0800 Subject: [PATCH 10/11] Fix iOS side compile error with `swift_version`. --- ios/flutter_inappbrowser.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/flutter_inappbrowser.podspec b/ios/flutter_inappbrowser.podspec index fa736f298..c4c5ad4ee 100644 --- a/ios/flutter_inappbrowser.podspec +++ b/ios/flutter_inappbrowser.podspec @@ -18,5 +18,6 @@ A new Flutter plugin. s.dependency 'Flutter' s.ios.deployment_target = '8.0' + s.swift_version = '4.0' end From d7edfc5ee4706070017f784bb60053a50d969c8b Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Thu, 24 Oct 2019 00:18:24 +0200 Subject: [PATCH 11/11] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..70fac8234 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: lorenzo_pichilli # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://www.paypal.me/LorenzoPichilli'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']