[
https://issues.apache.org/jira/browse/CB-14187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16564358#comment-16564358
]
ASF GitHub Bot commented on CB-14187:
-------------------------------------
brodybits 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_r206679000
##########
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:
I just discovered today that `npm run eslint` has a few failures:
```
/Users/brodybits/Documents/cordova/cordova-plugin-inappbrowser/tests/tests.js
714:32 error Strings must use singlequote quotes
715:1 error Expected indentation of 16 spaces but found 14 indent
715:15 error 'alert' is not defined no-undef
717:1 error Expected indentation of 16 spaces but found 14 indent
717:15 error 'alert' is not defined no-undef
722:13 error 'alert' is not defined no-undef
✖ 6 problems (6 errors, 0 warnings)
3 errors, 0 warnings potentially fixable with the `--fix` option.
```
I can think of 2 possible solutions for `'alert' is not defined`:
- use `// eslint-disable-line no-undef`
- preferred: use `window.alert` (less ugly, more likely to work on Windows
platform)
A nice bonus would be to fix `alert` --> `window.alert` throughout
`tests.js`.
----------------------------------------------------------------
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:
[email protected]
> cordova-plugin-inappbrowser AllowedSchemes for iOS
> --------------------------------------------------
>
> Key: CB-14187
> URL: https://issues.apache.org/jira/browse/CB-14187
> Project: Apache Cordova
> Issue Type: New Feature
> Components: cordova-plugin-inappbrowser
> Affects Versions: 3.0.0
> Reporter: wvengen
> Priority: Major
>
> CB-14013 add support for custom url schemes with the AllowedSchemes
> preference. This only works on Android, however. It would be very useful to
> have this on iOS (and other platforms) as well.
> A pull request for iOS will follow.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]