Closed Bug 1973269 Opened 5 months ago Closed 5 months ago

OpenNewWindow does not open the requested URL when startup session restore happens

Categories

(Core :: DOM: Service Workers, defect)

defect

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

Attachments

(1 file)

What's happening is that the attempt to load the URI from WaitForLoad is immediately overridden by SessionStoreUtils:

xul.dll!mozilla::dom::BrowsingContext::LoadURI(nsDocShellLoadState * aLoadState, bool aSetNavigating) Line 2012 (d:\gecko\docshell\base\BrowsingContext.cpp:2012)
xul.dll!nsSHistory::LoadURIOrBFCache(nsSHistory::LoadEntryResult & aLoadEntry) Line 1455 (d:\gecko\docshell\shistory\nsSHistory.cpp:1455)
xul.dll!nsSHistory::LoadURIs(nsTArray<nsSHistory::LoadEntryResult> & aLoadResults) Line 1459 (d:\gecko\docshell\shistory\nsSHistory.cpp:1459)
xul.dll!nsSHistory::ReloadCurrentEntry() Line 1525 (d:\gecko\docshell\shistory\nsSHistory.cpp:1525)
xul.dll!mozilla::dom::SessionStoreUtils::InitializeRestore(const mozilla::dom::GlobalObject & aGlobal, mozilla::dom::CanonicalBrowsingContext & aContext, nsISessionStoreRestoreData * aData, mozilla::ErrorResult & aError) Line 1667 (d:\gecko\toolkit\components\sessionstore\SessionStoreUtils.cpp:1667)
xul.dll!mozilla::dom::SessionStoreUtils_Binding::initializeRestore(JSContext * cx_, unsigned int argc, JS::Value * vp) Line 1783 (d:\gecko\obj-x86_64-pc-windows-msvc\dom\bindings\SessionStoreUtilsBinding.cpp:1783)
xul.dll!mozilla::dom::StaticMethodPromiseWrapper(JSContext * cx, unsigned int argc, JS::Value * vp) Line 3345 (d:\gecko\dom\bindings\BindingUtils.cpp:3345)
[Inline Frame] xul.dll!CallJSNative(JSContext * cx, bool(*)(JSContext *, unsigned int, JS::Value *) native, js::CallReason reason, const JS::CallArgs & args) Line 501 (d:\gecko\js\src\vm\Interpreter.cpp:501)
xul.dll!js::InternalCallOrConstruct(JSContext * cx, const JS::CallArgs & args, js::MaybeConstruct construct, js::CallReason reason) Line 597 (d:\gecko\js\src\vm\Interpreter.cpp:597)
xul.dll!InternalCall(JSContext * cx, const js::AnyInvokeArgs & args, js::CallReason reason) Line 664 (d:\gecko\js\src\vm\Interpreter.cpp:664)
xul.dll!js::CallFromStack(JSContext * cx, const JS::CallArgs & args, js::CallReason reason) Line 669 (d:\gecko\js\src\vm\Interpreter.cpp:669)
xul.dll!js::Interpret(JSContext * cx, js::RunState & state) Line 3287 (d:\gecko\js\src\vm\Interpreter.cpp:3287)
[Inline Frame] xul.dll!MaybeEnterInterpreterTrampoline(JSContext * cx, js::RunState & state) Line 395 (d:\gecko\js\src\vm\Interpreter.cpp:395)
xul.dll!js::RunScript(JSContext * cx, js::RunState & state) Line 471 (d:\gecko\js\src\vm\Interpreter.cpp:471)
xul.dll!js::InternalCallOrConstruct(JSContext * cx, const JS::CallArgs & args, js::MaybeConstruct construct, js::CallReason reason) Line 629 (d:\gecko\js\src\vm\Interpreter.cpp:629)
xul.dll!InternalCall(JSContext * cx, const js::AnyInvokeArgs & args, js::CallReason reason) Line 664 (d:\gecko\js\src\vm\Interpreter.cpp:664)
xul.dll!js::CallFromStack(JSContext * cx, const JS::CallArgs & args, js::CallReason reason) Line 669 (d:\gecko\js\src\vm\Interpreter.cpp:669)
xul.dll!js::jit::DoCallFallback(JSContext * cx, js::jit::BaselineFrame * frame, js::jit::ICFallbackStub * stub, unsigned int argc, JS::Value * vp, JS::MutableHandle<JS::Value> res) Line 1705 (d:\gecko\js\src\jit\BaselineIC.cpp:1705)
00000155d1733a02() (Unknown Source:0)
00000155d1739d66() (Unknown Source:0)

LoadURI is called for the same BrowsingContext, and thus the first load by service worker is overridden.

Assignee: nobody → krosylight

Currently we load the URI using the resulting BrowsingContext, but that causes race with session restore. Passing the URI as an argument to the browser chrome page solves the issue.

Attachment #9496052 - Attachment description: WIP: Bug 1973269 - Pass the URI directly to browser chrome page → Bug 1973269 - Pass the URI directly to browser chrome page r=asuth,gijs
See Also: → 1485961
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/4c2685c03cc1 https://hg.mozilla.org/integration/autoland/rev/3e2d9b5cfd28 Revert "Bug 1973269 - Pass the URI directly to browser chrome page r=asuth,Gijs" for causing junit failures @openWindowSameSession.

Backed out for causing junit failures @openWindowSameSession.

Flags: needinfo?(krosylight)

... why? This is #ifndef geckoview?

Flags: needinfo?(krosylight)

Maybe shouldLoadURI should be always true for GV.

Also these.

Flags: needinfo?(krosylight)

Probably the same reason as comment #6, thanks!

Flags: needinfo?(krosylight)

(because GeckoViewOpenWindow never sets bc at all... 😅)

Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d774d641a8ca https://hg.mozilla.org/integration/autoland/rev/f0be9859bd7b Revert "Bug 1973269 - Pass the URI directly to browser chrome page r=asuth,Gijs" for causing mochitest failures @ test_notification_serviceworker_openWindow.html

No backout so far and I hope it stay that way 🙏🏻

Flags: needinfo?(krosylight)
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
QA Whiteboard: [qa-triage-done-c143/b142]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: