Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web browser improvements #7218

Closed
wants to merge 4 commits into from
Closed

Conversation

LinusU
Copy link
Contributor

@LinusU LinusU commented Feb 28, 2020

Why

We are moving from react-native-inappbrowser-reborn and these where the options that we were using ☺️

How

I tried to stay as close to the code in react-native-inappbrowser-reborn as possible.

(I think it could be nice to do some more work here in the future to try and align the two packages as much as possible)

Test Plan

(I'm just about to test the change, will update this PR shortly, just need a quick lunch ☺️)

Here is the ugly hack I'm using to try this out in my app 😁

  "scripts": {
    "postinstall": "npm run patch-a && npm run patch-b",
    "patch-a": "curl https://raw.githubusercontent.com/expo/expo/b28bec7dcbe737504774b65005165722af3167a5/packages/expo-web-browser/android/src/main/java/expo/modules/webbrowser/WebBrowserModule.java > node_modules/expo-web-browser/android/src/main/java/expo/modules/webbrowser/WebBrowserModule.java",
    "patch-b": "curl https://raw.githubusercontent.com/expo/expo/b28bec7dcbe737504774b65005165722af3167a5/packages/expo-web-browser/ios/EXWebBrowser/EXWebBrowser.m > node_modules/expo-web-browser/ios/EXWebBrowser/EXWebBrowser.m"
  }

The changes are working great 👍

@mczernek
Copy link
Contributor

Thanks a lot for those changes! We love such contributions!

I've added them to our test example, corrected small issue on Android and added entry in CHANGELOG. You can take a look at this in here

Let me close this PR and move with work to the new one.

@mczernek mczernek closed this Feb 28, 2020
@znoue
Copy link

znoue commented Jun 23, 2020

Hello and thanks for those changes. I can't make readerMode work.

I patched the files then I call the browser like that :

let result = await WebBrowser.openBrowserAsync(news.url, {
      readerMode: true,
      enableBarCollapsing: true,
    })

It opens the browser but reader view is not active. Could someone tell me what's wrong with that ? Thank you again !

@mczernek
Copy link
Contributor

Maybe the site you're trying to open does not support Reader Mode? Have you tried on some popular site like Medium?

@znoue
Copy link

znoue commented Jun 23, 2020

Thank you for your quick answer, I don't think so since I can manually set "reader view" in the opened browser options and it works very well. I just can't manage to make it default mode.

I don't have any iPhone, i use the mac OS simulator, can it be related ?

@mczernek
Copy link
Contributor

Would you mind setting up a minimal example on https://snack.expo.io/ that would show your code and its error? And if you do so, please fire an issue and don't hestitate to mention me in it. I'll take a look as soon as you do that.

@LinusU LinusU deleted the web-browser-improvements branch December 17, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants