You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/04 18:25:37 UTC

[GitHub] [cordova-ios] NiklasMerz opened a new pull request #886: Add PreferredContentMode preference

NiklasMerz opened a new pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886


   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   iOS
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   This adds a prefrence to the webview which is useful for iPads. Apple introduced a setting which by defaults changes the useragent of iPads from `iPad` to `Macintosh` to provide a "desktop browsing experience". The new preference allows to change the default value.
   
   See original issue from IAB: apache/cordova-plugin-inappbrowser#687
   
   ### Description
   <!-- Describe your changes in detail -->
   Changed like : apache/cordova-plugin-inappbrowser#688
   
   Documenation: https://github.com/apache/cordova-docs/pull/1083
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   Automatic tests still pass. I found no automatic tests for preferences at build time.
   
   I created a blank new app, added this platform and checked `navigator.userAgent` while changing the preference. It should be `iPad` for `mobile` and `Macintosh` for `desktop`.
   
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [x] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [x] I've updated the documentation if necessary
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] erisu commented on a change in pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#discussion_r439197924



##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -135,6 +135,16 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
     }
     configuration.applicationNameForUserAgent = userAgent;
 
+    if (@available(iOS 13.0, *)) {
+        NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
+        if ([contentMode  isEqual: @"mobile"]) {

Review comment:
       ```suggestion
           if ([contentMode isEqual: @"mobile"]) {
   ```
   
   Removed double spaces




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] erisu commented on a change in pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#discussion_r439197973



##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -135,6 +135,16 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
     }
     configuration.applicationNameForUserAgent = userAgent;
 
+    if (@available(iOS 13.0, *)) {
+        NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
+        if ([contentMode  isEqual: @"mobile"]) {
+            configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
+        } else if ([contentMode  isEqual: @"desktop"]) {

Review comment:
       ```suggestion
           } else if ([contentMode isEqual: @"desktop"]) {
   ```
   
   Removed double spaces




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] mosabab edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
mosabab edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-645430203


   Merged it is good, but why the new information not added to the document for this pull?
   
   https://github.com/apache/cordova-docs/pull/1083


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] mosabab removed a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
mosabab removed a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-645430203


   Merged it is good, but why the new information not added to the document for this pull?
   
   https://github.com/apache/cordova-docs/pull/1083


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **increase** coverage by `1.89%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #886      +/-   ##
   ==========================================
   + Coverage   74.40%   76.30%   +1.89%     
   ==========================================
     Files          13       13              
     Lines        1676     1941     +265     
   ==========================================
   + Hits         1247     1481     +234     
   - Misses        429      460      +31     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/886/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `86.60% <0.00%> (+1.19%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...d27a366](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter commented on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #886   +/-   ##
   =======================================
     Coverage   74.40%   74.40%           
   =======================================
     Files          13       13           
     Lines        1676     1676           
   =======================================
     Hits         1247     1247           
     Misses        429      429           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...dcb32ea](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **increase** coverage by `1.89%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #886      +/-   ##
   ==========================================
   + Coverage   74.40%   76.30%   +1.89%     
   ==========================================
     Files          13       13              
     Lines        1676     1941     +265     
   ==========================================
   + Hits         1247     1481     +234     
   - Misses        429      460      +31     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/886/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `86.60% <0.00%> (+1.19%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...d27a366](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #886   +/-   ##
   =======================================
     Coverage   74.40%   74.40%           
   =======================================
     Files          13       13           
     Lines        1676     1676           
   =======================================
     Hits         1247     1247           
     Misses        429      429           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...d27a366](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] mosabab commented on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
mosabab commented on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-645430203


   Merged it is good, but why the document not add the new method for this pull?
   
   https://github.com/apache/cordova-docs/pull/1083


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] dpogue merged pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
dpogue merged pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #886   +/-   ##
   =======================================
     Coverage   74.40%   74.40%           
   =======================================
     Files          13       13           
     Lines        1676     1676           
   =======================================
     Hits         1247     1247           
     Misses        429      429           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...dcb32ea](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [cordova-ios] codecov-commenter edited a comment on pull request #886: Add PreferredContentMode preference

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #886:
URL: https://github.com/apache/cordova-ios/pull/886#issuecomment-639029590


   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=h1) Report
   > Merging [#886](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/02448ceb3b837e66890e702879bac9298f8a896a&el=desc) will **increase** coverage by `1.89%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-ios/pull/886/graphs/tree.svg?width=650&height=150&src=pr&token=WomDD5jInz)](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #886      +/-   ##
   ==========================================
   + Coverage   74.40%   76.30%   +1.89%     
   ==========================================
     Files          13       13              
     Lines        1676     1941     +265     
   ==========================================
   + Hits         1247     1481     +234     
   - Misses        429      460      +31     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/886/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `86.60% <0.00%> (+1.19%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=footer). Last update [02448ce...d27a366](https://codecov.io/gh/apache/cordova-ios/pull/886?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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