WesleyAC/deeplinks

Incompatibility with Bubble.io

Closed this issue · 2 comments

Hi,
We're trying to implement your plugin on a bubble.io app and we notice that the link get generated in the navigation bar URL, but when opened, nothing happens, we're not going to the selected text.

DEMO:

https://deeplink-to-text-plugin.bubbleapps.io/version-test

Do you have any hint?

Is there any actual text in the body when deeplink's script tag is processed? I just took a look at
your test case and I don't see any lorem text on the page when I set a breakpoint in deeplinks.
When I was running it it looks like it was processing script nodes on the page rather than lorem.

IIUC deeplinks runs an IIFE when it loads and that is when it looks at the URL to jump to that location on the page. If you are populating the page using javascript, deeplinks must not run until after the page is populated with text/lorem.

Maybe putting the script for deeplinks at the end of the head or at the bottom of the body will make it work?

I am not sure if implementing an onload or ready listener and injecting the deeplinks script tag
would work. Maybe: https://stackoverflow.com/questions/8578617/inject-a-script-tag-with-remote-src-and-wait-for-it-to-execute?

It worked using dynamic import()

Thanks for your fast reply!