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

feat: ios preprocessing page (url metadata) #145

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

achorein
Copy link
Owner

@achorein achorein commented Dec 13, 2024

Summary

on iOS we can use a JavaScript file to preprocess the webpage before the share extension is called (cf Accessing a Webpage). This is useful if we want to extract data directlty from the webpage and avoid to scrap the url in a second time.

Custom configuration example

    "plugins": [
      [
        "expo-share-intent",
        {
          "iosActivationRules": {
            "NSExtensionActivationSupportsWebURLWithMaxCount": 1,
            "NSExtensionActivationSupportsWebPageWithMaxCount": 1,
          },
          "preprocessorInjectJS": "metas['og\\:image'] = metas['og\\:image'] || document.querySelector('img#main-image')?.getAttribute('src')"
        }
      ],

Todo

  • Add generic preprocessing script
  • Auto extra all page header metadata (open graph) in share extension
  • send all metadata to application
  • add plugin configuration to add a custom rule to extract content
  • Update README.md

Issue

Fixes #142

@achorein achorein force-pushed the main branch 2 times, most recently from 605732b to 5780174 Compare December 13, 2024 08:09
@achorein achorein force-pushed the feat/ios-preprocessing-page branch 11 times, most recently from 132ccb4 to e01ff32 Compare December 15, 2024 16:26
@ansh
Copy link

ansh commented Dec 20, 2024

This would be an awesome feature to test!

@achorein achorein force-pushed the feat/ios-preprocessing-page branch from e01ff32 to 46e17a1 Compare December 21, 2024 12:38
@achorein achorein force-pushed the feat/ios-preprocessing-page branch from 46e17a1 to a94fa81 Compare December 21, 2024 12:44
@achorein achorein merged commit a6e1fc7 into main Dec 21, 2024
4 checks passed
@achorein achorein deleted the feat/ios-preprocessing-page branch December 21, 2024 12:49
@achorein
Copy link
Owner Author

@ansh now available ;)

@ansh
Copy link

ansh commented Dec 21, 2024

You're an absolute legend.

Thank you!

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.

[Feature Request] Preprocess webpage to extract data
2 participants