Closed Bug 1235431 Opened 9 years ago Closed 8 years ago

Implement windowClient.focus() in Fennec (Android)

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(firefox53 fixed)

RESOLVED FIXED
Firefox 53
Tracking Status
firefox53 --- fixed

People

(Reporter: edwong, Assigned: droeh)

References

Details

Attachments

(1 file, 1 obsolete file)

With push notifications, desktop often allows click on a notification to result in focusing a specific tab in the browser. Fennec doesn't have this capability. Chrome does (both in tabs as apps in tray, and as a single app)
I assume we want tapping on the Web Notification to open Fennec and select a specific tab. I don't know that we want a JS API to allow changing the active tab.
Yes, your assumptions are inline with my intent.
Blocks: android-push
Summary: Please support serviceWorker ability to set focus() a tab. → Please support serviceWorker ability to focus a tab after user taps notification
Catalin, does openWindow cover this?
Flags: needinfo?(catalin.badea392)
Or, maybe bug 1259164 fixes this? Edwin?
Flags: needinfo?(edwong)
(In reply to Andrew Overholt [:overholt] from comment #3) > Catalin, does openWindow cover this? No, I think this is about windowClient.focus() which is broken on android. On desktop, .focus() works by sending a special event to chrome which causes the tab to be switched. I think the android port uses a different chrome://..browser.js which lacks this functionality.
Flags: needinfo?(catalin.badea392)
I don't believe we've ever supported this (JS in a tab or service worker).
Flags: needinfo?(edwong)
(Clarifying summary)
Summary: Please support serviceWorker ability to focus a tab after user taps notification → Implement windowClient.focus() in Fennec (Android)
Assignee: nobody → droeh
This just handles "DOMServiceWorkerFocusClient" in browser.js by having Tabs.java foreground Fennec and select the correct tab.
Attachment #8810626 - Flags: review?(catalin.badea392)
Comment on attachment 8810626 [details] [diff] [review] Implement windowClient.focus() for Fennec Review of attachment 8810626 [details] [diff] [review]: ----------------------------------------------------------------- Bug 1303838 will merge "DOMServiceWorkerFocusClient" into "DOMWindowFocus", please make sure that won't break the change made here. Thanks!
Attachment #8810626 - Flags: review?(catalin.badea392) → review+
Pushed by droeh@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/38cde1f5d020 Implement windowClient.focus() for Fennec. r=catalinb
Backed out for failing mochitest test_openWindow.html on Android: https://hg.mozilla.org/integration/mozilla-inbound/rev/d4792f52f4761029eb416632312c61d92cf85497 Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=38cde1f5d020c01bf3f1645da84e2a34f134e69b Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=39634175&repo=mozilla-inbound 07:41:50 INFO - 461 INFO TEST-START | dom/workers/test/serviceworkers/test_openWindow.html 07:42:45 INFO - INFO | automation.py | Application ran for: 0:07:34.490014 07:42:45 INFO - INFO | zombiecheck | Reading PID log: /tmp/tmpwQMCqspidlog 07:42:46 INFO - /data/tombstones does not exist; tombstone check skipped 07:42:47 INFO - mozcrash Downloading symbols from: https://queue.taskcluster.net/v1/task/Z5JQbxVJToWqiSZ4-WD9mA/artifacts/public/build/fennec-53.0a1.en-US.android-arm.crashreporter-symbols.zip 07:42:53 INFO - mozcrash Copy/paste: /builds/slave/test/build/linux64-minidump_stackwalk /tmp/tmpN28Wya/1759f838-f158-cc29-28e6dd79-76899979.dmp /tmp/tmpxeKpjd 07:43:01 INFO - mozcrash Saved minidump as /builds/slave/test/build/blobber_upload_dir/1759f838-f158-cc29-28e6dd79-76899979.dmp 07:43:01 INFO - mozcrash Saved app info as /builds/slave/test/build/blobber_upload_dir/1759f838-f158-cc29-28e6dd79-76899979.extra 07:43:01 WARNING - PROCESS-CRASH | dom/workers/test/serviceworkers/test_openWindow.html | application crashed [@ mozilla::net::nsSocketTransport::InitiateSocket] 07:43:01 INFO - Crash dump filename: /tmp/tmpN28Wya/1759f838-f158-cc29-28e6dd79-76899979.dmp 07:43:01 INFO - Operating system: Android 07:43:01 INFO - 0.0.0 Linux 2.6.29-gea477bb #1 Wed Sep 26 11:04:45 PDT 2012 armv7l 07:43:01 INFO - CPU: arm 07:43:01 INFO - ARMv7 ARM Cortex-A8 features: swp,half,thumb,fastmult,vfpv2,edsp,neon,vfpv3 07:43:01 INFO - 1 CPU 07:43:01 INFO - GPU: UNKNOWN 07:43:01 INFO - Crash reason: SIGSEGV 07:43:01 INFO - Crash address: 0x0 07:43:01 INFO - Process uptime: not available 07:43:01 INFO - Thread 16 (crashed) 07:43:01 INFO - 0 libxul.so!mozilla::net::nsSocketTransport::InitiateSocket [nsSocketTransport2.cpp:38cde1f5d020 : 1272 + 0x2] 07:43:01 INFO - r0 = 0x00000173 r1 = 0xd4e5c80c r2 = 0x573e471f r3 = 0x00000000 07:43:01 INFO - r4 = 0x55492800 r5 = 0x58964780 r6 = 0x55492890 r7 = 0x5a088bb0 07:43:01 INFO - r8 = 0x57a9d658 r9 = 0x5a088d04 r10 = 0x00000001 r12 = 0x00000003 07:43:01 INFO - fp = 0x00000086 sp = 0x5a088b18 lr = 0x55ac4ed3 pc = 0x55ac4ee0 07:43:01 INFO - Found by: given as instruction pointer in context 07:43:01 INFO - 1 libxul.so!mozilla::net::nsSocketTransport::OnSocketEvent [nsSocketTransport2.cpp:38cde1f5d020 : 1862 + 0x5] 07:43:01 INFO - r4 = 0x55492800 r5 = 0x00000000 r6 = 0x54fc51a0 r7 = 0x57a9d658 07:43:01 INFO - r8 = 0x57a9d658 r9 = 0x5a088d04 r10 = 0x00000001 fp = 0x00000086 07:43:01 INFO - sp = 0x5a088cc0 pc = 0x55ac5683 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 2 libxul.so!mozilla::net::nsSocketEvent::Run [nsSocketTransport2.cpp:38cde1f5d020 : 85 + 0x5] 07:43:01 INFO - r4 = 0x52d23340 r5 = 0x00000000 r6 = 0x5a088d00 r7 = 0x00000000 07:43:01 INFO - r8 = 0x5a088d4f r9 = 0x5a088d04 r10 = 0x00000001 fp = 0x00000086 07:43:01 INFO - sp = 0x5a088ce8 pc = 0x55ac570f 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 3 libxul.so!nsThread::ProcessNextEvent [nsThread.cpp:38cde1f5d020 : 1213 + 0x3] 07:43:01 INFO - r3 = 0x55ac5705 r4 = 0x52d23340 r5 = 0x00000000 r6 = 0x5a088d00 07:43:01 INFO - r7 = 0x00000000 r8 = 0x5a088d4f r9 = 0x5a088d04 r10 = 0x00000001 07:43:01 INFO - fp = 0x00000086 sp = 0x5a088cf0 pc = 0x55a69387 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 4 libxul.so!NS_ProcessNextEvent [nsThreadUtils.cpp:38cde1f5d020 : 361 + 0xb] 07:43:01 INFO - r4 = 0x00000001 r5 = 0xd076ecda r6 = 0x00000086 r7 = 0x00000000 07:43:01 INFO - r8 = 0x52d232c0 r9 = 0x00000000 r10 = 0xc84e2279 fp = 0x00000086 07:43:01 INFO - sp = 0x5a088d48 pc = 0x55a7bb7d 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 5 libxul.so!mozilla::net::nsSocketTransportService::Run [nsSocketTransportService2.cpp:38cde1f5d020 : 939 + 0x7] 07:43:01 INFO - r4 = 0x52d232a0 r5 = 0xd076ecda r6 = 0x00000086 r7 = 0x00000000 07:43:01 INFO - r8 = 0x52d232c0 r9 = 0x00000000 r10 = 0xc84e2279 fp = 0x00000086 07:43:01 INFO - sp = 0x5a088d58 pc = 0x55ac1e0f 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 6 libxul.so!nsThread::ProcessNextEvent [nsThread.cpp:38cde1f5d020 : 1213 + 0x3] 07:43:01 INFO - r4 = 0x52d23340 r5 = 0x00000000 r6 = 0x5a088df8 r7 = 0x00000000 07:43:01 INFO - r8 = 0x5a088e47 r9 = 0x5a088dfc r10 = 0x00000000 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088de8 pc = 0x55a69387 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 7 libxul.so!NS_ProcessNextEvent [nsThreadUtils.cpp:38cde1f5d020 : 361 + 0xb] 07:43:01 INFO - r4 = 0x00000000 r5 = 0x00000001 r6 = 0x52d163d0 r7 = 0x52d23340 07:43:01 INFO - r8 = 0x52dfc650 r9 = 0x52d23374 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088e40 pc = 0x55a7bb7d 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 8 libxul.so!mozilla::ipc::MessagePumpForNonMainThreads::Run [MessagePump.cpp:38cde1f5d020 : 338 + 0x7] 07:43:01 INFO - r4 = 0x52dfc640 r5 = 0x00000001 r6 = 0x52d163d0 r7 = 0x52d23340 07:43:01 INFO - r8 = 0x52dfc650 r9 = 0x52d23374 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088e50 pc = 0x55bd924d 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 9 libxul.so!MessageLoop::Run [message_loop.cc:38cde1f5d020 : 225 + 0x5] 07:43:01 INFO - r4 = 0x52d163d0 r5 = 0x5a088ea0 r6 = 0x5a088e9c r7 = 0x52d163d0 07:43:01 INFO - r8 = 0x52d2334c r9 = 0x52d23374 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088e80 pc = 0x55bc9f9b 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 10 libxul.so!nsThread::ThreadFunc [nsThread.cpp:38cde1f5d020 : 467 + 0x5] 07:43:01 INFO - r4 = 0x52d23340 r5 = 0x5a088ea0 r6 = 0x5a088e9c r7 = 0x52d163d0 07:43:01 INFO - r8 = 0x52d2334c r9 = 0x52d23374 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088e98 pc = 0x55a67049 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 11 libnss3.so!_pt_root [ptthread.c:38cde1f5d020 : 216 + 0x5] 07:43:01 INFO - r4 = 0x52d25500 r5 = 0x00000000 r6 = 0x52f08380 r7 = 0x2a30ad48 07:43:01 INFO - r8 = 0x52f08380 r9 = 0x59f89000 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088ec8 pc = 0x52e768d1 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 12 libc.so!__thread_entry [pthread_create.cpp : 92 + 0x6] 07:43:01 INFO - r4 = 0x5a088f00 r5 = 0x2a30ad48 r6 = 0x52e76815 r7 = 0x52d25500 07:43:01 INFO - r8 = 0x5295f774 r9 = 0x59f89000 r10 = 0x5a088f00 fp = 0x2a30ad48 07:43:01 INFO - sp = 0x5a088ee8 pc = 0x40033a5c 07:43:01 INFO - Found by: call frame info 07:43:01 INFO - 13 libc.so!pthread_create [pthread_create.cpp : 201 + 0x16] 07:43:01 INFO - r3 = 0x52d25500 r4 = 0x00000002 r5 = 0x00100000 r6 = 0x52d25500 07:43:01 INFO - r7 = 0x00000078 r8 = 0x5295f774 r9 = 0x59f89000 r10 = 0x5a088f00 07:43:01 INFO - fp = 0x2a30ad48 sp = 0x5a088f00 pc = 0x40033bd8 07:43:01 INFO - Found by: call frame info
Flags: needinfo?(droeh)
This patch implements something that was previously effectively a noop, and it passes this test locally for me. I'll do a try run and see if it's something emulator-specific or something.
Flags: needinfo?(droeh)
Same as the previous version except for some small Java changes to fix the test breakage. Carrying over Catalin's r+.
Attachment #8810626 - Attachment is obsolete: true
Attachment #8816265 - Flags: review+
Pushed by droeh@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/6ee056796f7b Implement windowClient.focus() for Fennec. r=catalinb
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: