Contextual Identities: Allow matching on cookieStoreId for browser.contentScripts.register
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(firefox97 fixed)
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: ntninja, Assigned: onlinericha19)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [privacy])
Attachments
(1 file, 6 obsolete files)
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
This would also help with my problem that normal contentScripts do not know in which container they run in. In CanvasBlocker there are settings that are dependent on the cookieStoreId (some rng seeds to make the rng consistent within a container but different between them - this is necessary to prevent fingerprint crosstask - so completely in the spirit of the containers which are a really great thing).
So to know these I have to send a message to the main script (via browser.runtime.connect) that then returns the cookieStoreId. But as this is an asynchronous operation I have a race condition (https://github.com/kkapsner/CanvasBlocker/issues/369).
Having the ability to register content scripts depending on the cookieStoreId could this problem.
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D93005
Updated•5 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D93551
Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 9•3 years ago
|
||
dev-doc-needed: need entry in BCD and bullet point on MDN at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contentScripts/register
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Backed out for failures on test_ext_contentScripts_register.js
-
backout: https://hg.mozilla.org/integration/autoland/rev/c6d5703087a2ee156eb56cd492e66f8c9d812189
-
failure log: https://treeherder.mozilla.org/logviewer?job_id=360401368&repo=autoland&lineNumber=3944
[task 2021-12-07T14:06:36.728Z] 14:06:36 INFO - TEST-START | xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js
[task 2021-12-07T14:06:36.799Z] 14:06:36 INFO - adb launch_application: am startservice -W -n 'org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.XpcshellTestRunnerService$i0' -a android.intent.action.MAIN --es env0 XPCOM_DEBUG_BREAK=stack-and-abort --es env1 MOZ_CRASHREPORTER=1 --es env2 MOZ_CRASHREPORTER_NO_REPORT=1 --es env3 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es env4 MOZ_DEVELOPER_REPO_DIR=/builds/worker/checkouts/gecko --es env5 MOZ_DISABLE_CONTENT_SANDBOX=1 --es env6 MOZ_FETCHES_DIR=/builds/worker/fetches --es env7 MOZ_DISABLE_SOCKET_PROCESS=1 --es env8 MOZ_WEBRENDER=1 --es env9 MOZ_ACCELERATED=1 --es env10 LD_LIBRARY_PATH=/data/local/tmp/test_root/xpcb --es env11 MOZ_LINKER_CACHE=/data/local/tmp/test_root/xpcb --es env12 GRE_HOME=/data/local/tmp/test_root/xpcb --es env13 XPCSHELL_TEST_PROFILE_DIR=/data/local/tmp/test_root/xpc/p/36958c66-6d00-4c6f-b80e-b072b100c4b1 --es env14 HOME=/data/local/tmp/test_root/xpc/p --es env15 XPCSHELL_TEST_TEMP_DIR=/data/local/tmp/test_root/xpc/tmp/f9fa36d1-59d9-491f-9500-59c380a304b0 --es env16 MOZ_ANDROID_DATA_DIR=/data/local/tmp/test_root/xpcb --es env17 MOZ_IN_AUTOMATION=1 --es env18 MOZ_ANDROID_CPU_ABI=x86_64 --es env19 MOZHTTP2_PORT=43305 --es env20 MOZNODE_EXEC_PORT=34815 --es env21 TMPDIR=/data/local/tmp/test_root/xpc/p/36958c66-6d00-4c6f-b80e-b072b100c4b1 --es env22 XPCSHELL_MINIDUMP_DIR=/data/local/tmp/test_root/xpc/minidumps/36958c66-6d00-4c6f-b80e-b072b100c4b1 --es arg0 -g --es arg1 /data/local/tmp/test_root/xpcb --es arg2 --greomni --es arg3 /data/local/tmp/test_root/xpcb/geckoview-test_runner.apk --es arg4 -m --es arg5 -e --es arg6 'const _HEAD_JS_PATH = "/data/local/tmp/test_root/xpc/head.js";' --es arg7 -e --es arg8 'const _MOZINFO_JS_PATH = "/data/local/tmp/test_root/xpc/p/36958c66-6d00-4c6f-b80e-b072b100c4b1/mozinfo.json";' --es arg9 -e --es arg10 'const _PREFS_FILE = "/data/local/tmp/test_root/xpc/tmp/f9fa36d1-59d9-491f-9500-59c380a304b0/user.js";' --es arg11 -e --es arg12 'const _TESTING_MODULES_DIR = "/data/local/tmp/test_root/xpc/m";' --es arg13 -f --es arg14 /data/local/tmp/test_root/xpc/head.js --es arg15 -e --es arg16 'const _HEAD_FILES = ["/data/local/tmp/test_root/xpc/toolkit/components/extensions/test/xpcshell/head.js", "/data/local/tmp/test_root/xpc/toolkit/components/extensions/test/xpcshell/head_telemetry.js", "/data/local/tmp/test_root/xpc/toolkit/components/extensions/test/xpcshell/head_sync.js", "/data/local/tmp/test_root/xpc/toolkit/components/extensions/test/xpcshell/head_storage.js"];' --es arg17 -e --es arg18 'const _JSDEBUGGER_PORT = 0;' --es arg19 -e --es arg20 'const _TEST_CWD = "/data/local/tmp/test_root/xpc/toolkit/components/extensions/test/xpcshell";' --es arg21 -e --es arg22 'const _TEST_FILE = ["test_ext_contentScripts_register.js"];' --es arg23 -e --es arg24 'const _TEST_NAME = "xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js";' --es arg25 -e --es arg26 '_execute_test(); quit(0);' --ez use_multiprocess True --es out_file /data/local/tmp/test_root/xpc/logs/xpcshell-115d88bf-21f5-4570-ba15-5b507493467e.log
[task 2021-12-07T14:06:37.052Z] 14:06:37 INFO - remotexpcshelltests.py | xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js | 29152 | Launched Test App
[task 2021-12-07T14:06:40.651Z] 14:06:40 INFO - remotexpcshelltests.py | xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js | 29152 | Application ran for: 0:00:03.921890
[task 2021-12-07T14:06:40.732Z] 14:06:40 WARNING - TEST-UNEXPECTED-FAIL | xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js | xpcshell return code: 0
[task 2021-12-07T14:06:40.732Z] 14:06:40 INFO - TEST-INFO took 4004ms
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - >>>>>>>
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - running event loop
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js | Starting check_remote
[task 2021-12-07T14:06:40.733Z] 14:06:40 INFO - (xpcshell/head.js) | test check_remote pending (2)
[task 2021-12-07T14:06:40.734Z] 14:06:40 INFO - TEST-PASS | xpcshell.ini:toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js | check_remote - [check_remote : 1] useRemoteWebExtensions matches - false == false
Comment 12•3 years ago
|
||
Test failure on Android happens for the same reason as in bug 1743616.
To resolve that, see https://phabricator.services.mozilla.com/D124537#inline-732229
Updated•3 years ago
|
Assignee | ||
Comment 13•3 years ago
|
||
Depends on D124537
Updated•3 years ago
|
Updated•3 years ago
|
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
Comment 16•3 years ago
|
||
bugherder |
Comment 17•3 years ago
|
||
What about browser.userScripts.register
?
Comment 18•3 years ago
|
||
(In reply to erosman from comment #17)
What about
browser.userScripts.register
?
That will be addressed in bug 1738567, using the internals introduced in this bug.
Comment 19•3 years ago
|
||
Is the following the behaviour of setting cookieStoreId
in browser.contentScripts.register
?
(supposing user has allowed the extension to run in private mode)
- no cookieStoreId => inject into all tabs
firefox-private
=> inject only into private tabsfirefox-default
=> inject only into non-private, non-container tabsfirefox-container-N
=> inject only into firefox-container-N tabs
Comment 20•3 years ago
|
||
(In reply to erosman from comment #19)
Is the following the behaviour of setting
cookieStoreId
inbrowser.contentScripts.register
?
(supposing user has allowed the extension to run in private mode)
- no cookieStoreId => inject into all tabs
firefox-private
=> inject only into private tabsfirefox-default
=> inject only into non-private, non-container tabsfirefox-container-N
=> inject only into firefox-container-N tabs
Yes. And cookieStoreId
can be an array if you'd like to support injection in one or multiple targets.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•