0

I have some data in my HTML page, I need to encrypt this data in local APP.

To do this, I add a Custom URL scheme on client machine as following page descripted: Custom protocol handler in chrome

So, I can trigger my local APP and send data to it. In my local APP, data is encrypted. But how can I send the encrypted data back to my HTML page?

Really appreciate your reply, thanks!

John
  • 41
  • 5

1 Answers1

0

One approach is to use a query string:

example.com/my-page/?myfruit1=apple&myfruit2=banana

You may then use the URLSearchParams interface in javascript to access the various parts of the query string.

e.g.

  • URLSearchParams.has()
  • URLSearchParams.get()
  • URLSearchParams.getAll()

etc.


Further Reading:

Rounin
  • 27,134
  • 9
  • 83
  • 108
  • 1
    Dear Rounin, Thanks for your reply. But I still don’t know how to send data from my local APP to HTML page. As I understand “query string” is part of URL. That means query sting is the data browser send to web server. How can my APP send data to HTML page? Can you give me a sample program? Thank you very much for your patient reply! – John Jul 14 '20 at 09:18
  • Perhaps I've misunderstood your question, @John. Is it not possible to have your app open a page in your browser, using the `https://` protocol? – Rounin Jul 15 '20 at 13:09