-
Notifications
You must be signed in to change notification settings - Fork 75
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
Running Promnesia crashes Facebook (and some other sites) #341
Comments
Yeah, can confirm it happens on your garden site. To workaround there are a few options at the moment
I think the right thing to do (considering it's inevitable that page modifications would break something) would be:
|
Can confirm that disabling Will think on what workaround works best 🤔 Proper solutions wise: I think it's possible to make the feature work more reliably without crashing things. For example my extension https://github.com/transclude-me/extension does very similar things mechanics-wise (mark up relevant links & show popup when you hover over them) without causing any crashes (afaik) I believe what makes the difference is that I do mark-up in CSS-only way (add a class to relevant links and style them differently) and don't modify the DOM |
Interesting, thanks for the reference! (cool extension by the way :) ) IIRC the main reason I was wrapping elements into extra HTML was to add a bit which activates the popup on hover -- not sure if it's possible with CSS? I guess in your case it works because you're using a hotkey + hover to activate -- I'd personally prefer if I didn't have to. Although maybe it's a good compromise in return for managing with CSS only (or could be configurable depending what the user preferes). promnesia/extension/src/showvisited.js Lines 186 to 199 in 32b8e9a
|
um, I think you can just add a onHover event listener to the link element? In my case I'm outsourcing it to the Tippy.js library, the hotkey part is not something essential to it working, just a preferred UX for me. |
Ha, I guess I was a bit too much in the "static html" mindset, didn't even occur to me to do it via javascript. I guess that makes more sense in this case considering the tradeoff of modifying the page, yeah. Thanks for tippy.js -- would be very cool if I can replace my custom code with something mature 🙏 For my own reference later:
I might give it a try soon -- I've been meaning to update extension towards better Manivest v3 support anyway. If you think Promnesia could benefit from any other existing libraries -- please throw in in your suggestions :) |
fyi you're looking at the version of the docs for the older version of the lib https://atomiks.github.io/tippyjs/v6/all-props/#sticky |
🔥
will do! |
also that is me specifically adding the "guard button" support bc tippy does not provide that by default. basic usage is a lot simpler: https://atomiks.github.io/tippyjs/#html-content |
https://github.com/GoogleChromeLabs/text-fragments-polyfill plausibly as a one way to do highlights |
I used https://github.com/caroso1222/notyf for notifications, though not sure how annoying is to do them yourself |
very likely not worth it to switch if things are working, but I find Parcel a lot more pleasent to work with vs WebPack |
Thanks -- I actually used https://github.com/apvarun/toastify-js -- not sure which is better. For some reason it's vendorized in promnesia instead of being a proper npm dependency -- perhaps some webpack shenanigans.
thanks, also noticed you were using it and was surprised to find it had almost no configuration 😅 I might try it |
@Stvad curious, how did you manage to release your extension with Tippy.js without running in linting errors during publishing due to |
…cky custom code this should make it less glitchy easier to maintain see #341
So, managed to release after all with some horrible JS patching, but it works! Basically it shouldn't do any DOM structure modification for "mark visited", doesn't crash facebook for me 😎 Doesn't break https://vlad.roam.garden anymore, but seems like there is a style clash between tippies used on your site and the ones in Promnesia -- odd since I specifically used an extra CSS class to prevent this, but will investigate more before merging |
hrm, I haven't really used the web-ext lint before 😅. I suppose these particular warnings are not cause for review rejection 🤷♂️ |
Yay! Will give it a try! |
Hmm, so the issue with tippy on https://vlad.roam.garden/ is that when promnesia injects tippy CSS into the page, it seems to override some attributes (even if I don't do anything else with the page) Tippy has a namespace configuration, but it's a build-time thing, so not sure how to change it when it's already bundled up... https://github.com/atomiks/tippyjs/blob/master/.config/rollup.config.js#L12 Regarding dark mode -- tried dark mode on your site, but it looks okay, can you link the exact page where you seeing this? :) |
…cky custom code this should make it less glitchy easier to maintain see #341
…cky custom code this should make it less glitchy easier to maintain see #341
Actually reproduced the dark mode issue -- and also fixed other glitches on your garden. The trick was to use headless tippy.js since it's not as intrusive (also solves the problem with innerHTML) |
Nice! FWIW the dark mode issue was on FB |
Ah, yes I've seen it haha -- generally things are glitchy on extension update -- perhaps need to support some sort of callback. But been low on my priority list since releases are not that often |
…cky custom code this should make it less glitchy easier to maintain see #341
Right, so after investigation it seems that it's because one of the parent elements for the link has It seems that it might have been fixed in popper (which is renamed to floating-ui now?), but tippyjs is using a version which is too old. There is an issue for migration, but not sure if it happens anytime soon atomiks/tippyjs#1071 It's also possible to create tooltips in floating-ui directly, but I'm worried I'll have to reimplement quite a few things Ended up doing a hack, that finds the closest parent element without |
damn.. turned out to be a bit easier, needed to use |
…cky custom code this should make it less glitchy easier to maintain see #341
basically for links contained inside an element that uses contain: layout see #341 (comment)
a bit late for your various woes (though may still be useful as a general approach): in my extension I attach the tippy to a node in a shadow dom, which allows me to isolate it's CSS/etc. Generally putting your page elements into a shadow dom is very helpful to minimize interferance |
Oh interesting! First time I've heard of shadow dom, will check it out. Do you know if there is a meaningful difference with iframe? E.g. would it make sense to put the sidebar in shadow dom instead? |
If you're happy with it - I probably won't bother. I think shadow dom allows for easier integration of the component into the main page, while preserving the isolation (e.g. matching layout, etc). But that's not really relevant for the sidebar (or a popup, I suppose) as it stands alone. And in my model it's easier to programmatically interact with things across the shadow boundary. |
I've been running the tippyjs version and think it's been very smooth -- so will merge soon and start motions to release in chrome/mozilla stores :) |
…cky custom code this should make it less glitchy easier to maintain see #341
basically for links contained inside an element that uses contain: layout see #341 (comment)
…cky custom code this should make it less glitchy easier to maintain see #341
basically for links contained inside an element that uses contain: layout see #341 (comment)
It's released everywhere! |
Recipe is something like:
A similar story occurs on my digital garden website: https://vlad.roam.garden. Algorithm is similar but instead of scrolling timeline - the action is to open internal ink (which should open in a new side-panel).
The common thing between those two, I think is, triggering a React re-render
Running it in Firefox 109.0b6, macOS 13.1
The text was updated successfully, but these errors were encountered: