Closed Bug 1622500 Opened 4 years ago Closed 4 years ago

Implement cookieStoreId parameter for tabs.create

Categories

(GeckoView :: Extensions, enhancement, P2)

Unspecified
All
enhancement

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: gl, Assigned: gl)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [fenix:q2:2020])

Attachments

(1 file)

This implements the cookieStoreId parameter for tabs.create() that will allow for creating container tabs.

Priority: -- → P3

Fenix request that work for this issue be completed in Q2 ahead of implementation of containers in Fenix in Q3.

Whiteboard: [fenix:q2:2020]
Rank: 15
Priority: P3 → P2

Still a wip.

Whiteboard: [fenix:q2:2020] → [fenix:q2:2020][geckoview:m78]

We would like to see this done in Q2 for Fenix.

Whiteboard: [fenix:q2:2020][geckoview:m78] → [fenix:q2:2020]

Comment on attachment 9142152 [details]
Bug 1622500 - Implement cookieStoreId parameter for tabs.create.

I am still running into an error https://treeherder.mozilla.org/#/jobs?repo=try&revision=02d4a960cc5778679732e6967f9837938897721d&selectedTaskRun=DxuTEXuTQnOcR2E8qtbjHg-0 and wondering if you know where else I am missing the changes to get the mochitest to pass.

TEST-UNEXPECTED-FAIL | mobile/android/components/extensions/test/mochitest/test_ext_tabs_create.html | Expected value for tab.cookieStoreId - Expected: firefox-container-1, Actual: firefox-default

with the changes to the TestRunnerActivity.java to pass in the GeckoSessionSetting with the contextId when creating a GeckoSession. I also made a similar change to GeckoViewActivity.java, which I don't know if we want to keep or not.

I added a test in WebExtensionTest.java in the meantime which gives me a bit more confidence.

Attachment #9142152 - Flags: feedback?(agi)

Responded on Phabricator, copying it here:

From what I can see you also need to update get cookieStoreId here: https://searchfox.org/mozilla-central/source/mobile/android/components/extensions/ext-utils.js#319-321

GeckoView uses a different attribute than Desktop, so the current implementation does not work. We set an attribute called geckoViewSessionContextId, so the implenetion of get cookieStoreId should read that instead, e.g. this.browser.getAttribute("geckoViewSessionContextId") should give you the right value, except...

There's an extra step, for safety we transform the id a bit, see here: https://searchfox.org/mozilla-central/rev/446160560bf32ebf4cb7c4e25d7386ee22667255/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/StorageController.java#186-201 basically we append the string "gvctx" to the bytes hex representation of the string. To get the id that the extension is passed in we need to do the reverse transformation before returning it in the method above.

We can also chat about this on zoom/matrix if it makes it easier :)

Attachment #9142152 - Flags: feedback?(agi) → feedback+

I also made a similar change to GeckoViewActivity.java, which I don't know if we want to keep or not.

Yeah we need both, this one is for GeckoViewExample and the other one is for tests.

Pushed by gluong@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fd31c8d82b41
Implement cookieStoreId parameter for tabs.create. r=geckoview-reviewers,agi
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
See Also: → 1638878
Regressions: 1643688
Blocks: 1372178
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: