You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/08/01 06:39:12 UTC

[GitHub] wvengen commented on a change in pull request #274: CB-14187: (ios) Change the InAppBrowser to allow custom schemes

wvengen commented on a change in pull request #274: CB-14187: (ios) Change the InAppBrowser to allow custom schemes
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/274#discussion_r206768695
 
 

 ##########
 File path: tests/tests.js
 ##########
 @@ -693,4 +698,29 @@ exports.defineManualTests = function (contentEl, createActionButton) {
             });
         });
     }, 'openHardwareBackDefaultAfterNo');
+
+    // Customscheme
+    createActionButton('customscheme', function () {
+        var ref = cordova.InAppBrowser.open('about:blank', '_blank', 'hidden=yes');
+        var openedCustomscheme = false;
+        ref.addEventListener('loadstop', function (e) {
+            // Avoid showing the alert twice on iOS, since loadstop is also being called after the customscheme event.
+            if (!openedCustomscheme) {
+                openedCustomscheme = true;
+                ref.executeScript({ code: 'window.location.replace("custom://test");' });
+            }
+        });
+        ref.addEventListener('customscheme', function (e) {
+            if (e && e.url === "custom://test") {
 
 Review comment:
   Thanks! I went for the bonus in 93077ef (hoping it will help motivate you to complete the review ;) ). Tested it still works (Android).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org