Open Bug 1029203 Opened 10 years ago Updated 6 months ago

Emulate being offline

Categories

(DevTools :: Netmonitor, enhancement, P3)

30 Branch
x86
macOS
enhancement

Tracking

(Not tracked)

People

(Reporter: canuckistani, Unassigned)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [difficulty=hard] )

Attachments

(1 file)

It would be useful to have a switch that completely emulates being offline, for the current tab. Chrome does this as part of their new network emulation feature.
There used to be an excellent addon that did this. Unfortunately it was Windows only and used it's own dll for the throttling service but maybe we could draw a little inspiration from it's implementation:
https://github.com/hkirsman/Firefox-Throttle/blob/master/src/components/FFThrWatcher.js#L71
Whiteboard: [devedition-40]
Assigning P1 priority for some devedition-40 bugs. 

Filter on '148DD49E-D162-440B-AE28-E22632FC20AC'
Priority: -- → P1
I think `Services.io.offline = false` would do something similar, but the issue is that it is global to the whole browser.
FxOS implemented something better and supports toggling just one app into offline mode:
  Services.io.setAppOffline()
  http://mxr.mozilla.org/mozilla-central/source/netwerk/base/nsIIOService.idl#169

I tried to fake an app on a tab and used this setAppOffline API, but it doesn't seem to work.

Anyway, this features allows us to have an idea how hard it would be to have a per-docshell offline state:
  http://mxr.mozilla.org/mozilla-central/ident?i=IsAppOffline
  http://mxr.mozilla.org/mozilla-central/ident?i=NS_IsAppOffline
i.e. quite significant work!

For example:
  http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsHttpChannel.cpp#2715
Adding difficulty=hard whiteboard - please adjust if you disagree but I suspect this is what Alex means.

Alex - if you have some time while you're thinking about this issue, can you file a platform bug to represent the platform changes we would need to set a tab in an offline state? Please cc me.
Flags: needinfo?(poirot.alex)
Whiteboard: [devedition-40] → [devedition-40][difficulty=hard]
Whiteboard: [devedition-40][difficulty=hard] → [difficulty=hard]
Depends on: 1156659
Done, bug 1156659.
Flags: needinfo?(poirot.alex)
Triaging. Not a P1 anymore according to our new triage process, and not being actively worked on (filter on CLIMBING SHOES).
Priority: P1 → P3
Hey Honza, I think this has been implemented in another bug, right? If so, can you close it as a duplicate please?
Severity: normal → enhancement
Component: Developer Tools → Developer Tools: Netmonitor
Flags: needinfo?(odvarko)
(In reply to Patrick Brosset <:pbro> from comment #7)
> Hey Honza, I think this has been implemented in another bug, right? If so,
> can you close it as a duplicate please?
I don't know about any new net feature that would implement this.
Also, the platform bug 1156659 is still open.

Note, that we recently implemented pause/resume (bug 1005755), but it's different thing.

Honza
Flags: needinfo?(odvarko)
Product: Firefox → DevTools
Blocks: rdm-device
Attached image image.png

The offline option could be part of the Throttling drop down, as mentioned here:

https://mobile.twitter.com/nhoizey/status/1094871488707080192
https://pbs.twimg.com/media/DzHDz3QX0AALDPO.jpg

Honza

Severity: normal → S3
Duplicate of this bug: 1802741

If someone is going to implement this, please also consider adding an option to the CLI so the browser can be started in offline mode (if a --set-pref won't do the trick)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: