Open skorokithakis opened 5 years ago
Sure. I reported the bug to Mozilla. Currently they consider it normal for it not to work. I explained the use case and am waiting for an answer.
Thanks for the follow-up! So basically it's not that it doesn't work, they just don't cache the page past what its headers specify. Let's see what happens.
I added instant.page 1.1.0 to my home page, and the prefetching doesn't seem to be working in Firefox even when cache headers are set: https://joshduff.com/
Works niftily in Chrome, though.
Never mind – the issue went away when I updated Firefox :-x
@TehShrike What versions are you using? (the one working and the one not working) Would be good to know which versions of Firefox are compatible with this library (and state it in website)
It's actually still not working on my Windows machine, on Firefox 65.0.1 :-o
(When I mouse over a link, there is no network request made)
Are you using uBlock Origin? I found out two days ago that it disables prefetching on Firefox. (I plan on adding a mention on the website.) I reported this to uBlock Origin asking if they could allow same-origin, unfortunately there’s no way.
@dieulot good call! I did have uBlock on my Windows machine. I disabled uBlock and tried again, and it worked as expected. Thanks for figuring that out.
The bug has been acknowledged by Mozilla. It’s P3 (low priority) and depends on a refactoring, so I guess we’ll have to wait quite a bit before it’s resolved.
Is there a way to detect if this isn't going to work and disable it when so? Right now, it just pings the server twice, doubling the load on the server. Once for the hover and once for the click.
Sounds like a simple useragent check for now
Yeah, I’ll do an option to disable it on Firefox for now.
@dieulot This may be out of scope for instant.page, but wouldn't using fetch()
instead of link rel="prefetch"
bypass the issue with uBlock Origin on Firefox? fetch()
has different semantics from prefetch
(it's higher-priority), but it should technically be able to do the job.
uBlock Origin on Firefox disables prefetching on every startup, so even if you enable network.prefetch-next
manually in about:config
, it will be disabled again when you restart Firefox :slightly_frowning_face:
Good idea @Calinou! I’ll look into it.
When uBlock origin is enabled (not for the page, enabled in the browser at all!) prefetching doesn't seem to work. But even when it does (showing up in the network inspector), it's not particularly instant at all - it's like nothing was even preloaded :/
Ugh. Nothing has happened on the Firefox bug. Looks like a classic Mozilla move.
I know you're aware of this, but can we have an issue to track the problem?