readthedocs / addons

JavaScript client to integrate with Read the Docs nicely
https://readthedocs-addons.readthedocs.io/
MIT License
22 stars 6 forks source link

POC Monkey-patch history pushState and replaceState to listen to location changes #455

Open zanderle opened 3 days ago

zanderle commented 3 days ago

Closes #157

zanderle commented 3 days ago

@humitos this just does the monkey-patching for now (haven't added any listeners yet). Do we want to do a test-build with this, to see if it correctly picks up the "page changes", before we move on to the next step?

humitos commented 18 hours ago

Do we want to do a test-build with this, to see if it correctly picks up the "page changes", before we move on to the next step?

How hard would it be to create a simple example for this using the index.html page from this repository?

I tested using test-builds locally and I can confirm the custom method is called when changing pages on Docusaurus and Material for MkDocs (I added some small console.log) --but I don't want you to deal with my current setup since it's a complex.

zanderle commented 15 hours ago

Do we want to do a test-build with this, to see if it correctly picks up the "page changes", before we move on to the next step?

How hard would it be to create a simple example for this using the index.html page from this repository?

I tested using test-builds locally and I can confirm the custom method is called when changing pages on Docusaurus and Material for MkDocs (I added some small console.log) --but I don't want you to deal with my current setup since it's a complex.

I think I can make it work locally, to develop, and then I'll ask you to do a proper test on your setup