gecko-dev/devtools/shared
Nicolas Chevobbe 319761998f Bug 1752342 - [devtools] Fix isFrameWithChildTarget for iframe blocked by CSP. r=jdescottes.
The function was returning true as long as the passed element
was an iframe and EFT was enabled.
But if the passed iframe was blocked by a CSP rule, it would
still return true, although we wouldn't actually have a dedicated
document, nor a target, for that iframe, which would lead to
issues in the inspector when trying to fetch the iframe children.
We fix this by adding a new `isFrameBlockedByCSP` util, which  uses
`nsIContentPolicy#shouldLoad` with the iframe url so we can check if the iframe
is blocked by CSP, and in such case, return false.
We're also using this new function in the `NodeActor#form` method to set a `numChildren`
of `0` when the iframe is blocked (so in the inspector, the expand icon will be
hidden for the element), as well as in `WalkerActor#_getChildren` to return an
empty array when called with an iframe blocked by CSP.

A new test is added to check the iframe nodeFront properties and usage of
`WalkerFront#children` with those. We allow to set a specific pref to bypass
the guard in the children method in order to properly check that the root issue
of a given bug was fixed.

Differential Revision: https://phabricator.services.mozilla.com/D137667
2022-02-03 17:48:32 +00:00
..
commands Bug 1750834 - Enable devtools on fission everywhere. r=mccr8,releng-reviewers,gbrown 2022-01-31 18:09:41 +00:00
compatibility Bug 1753041 - [devtools] Remove devtools/shared/compatibility/yarn.lock. r=daisuke. 2022-02-02 06:06:50 +00:00
css Bug 1748174 - Remove touch-action pref. r=hiro 2022-01-05 12:28:07 +00:00
discovery Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
heapsnapshot Merge autoland to mozilla-central. a=merge 2022-01-22 23:47:38 +02:00
images Bug 1531311 - [devtools] Add more visibility for node picker when debugging remote pages. r=jdescottes,devtools-backward-compat-reviewers. 2021-12-11 10:58:35 +00:00
inspector Bug 1733537 - [devtools] Replace usage of NodeFront#getAllSelectors with a command. r=jdescottes,devtools-backward-compat-reviewers. 2021-11-04 08:58:05 +00:00
jsbeautify
layout Bug 1752342 - [devtools] Fix isFrameWithChildTarget for iframe blocked by CSP. r=jdescottes. 2022-02-03 17:48:32 +00:00
loader Bug 1745240 - [devtools] Unify target helpers and JS Window actors to use a shared method to filter BrowsingContext/WindowGlobal's. r=nchevobbe,jdescottes 2022-01-10 17:42:09 +00:00
locales Bug 1745932 - [devtools] Move highlighters.properties to fluent. r=fluent-reviewers,flod,jdescottes. 2021-12-17 16:19:04 +00:00
node-properties
performance Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
performance-new Bug 1639716 - [profiler] Remove the profiler disabling by private browsing r=jdescottes,gerald,devtools-backward-compat-reviewers 2022-01-26 17:26:21 +00:00
platform
protocol Bug 1746952 - [devtools] Fix targetFront attribute of all storage resources. r=nchevobbe 2021-12-22 09:59:09 +00:00
qrcode Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
security Bug 1741425 - Enable more xpcshell tests with socket process, r=ahal 2022-01-11 09:50:14 +00:00
specs Bug 1639716 - [devtools performance] Remove all actor code related to the profiler locking mechanism by private browsing r=jdescottes,devtools-backward-compat-reviewers 2022-01-26 17:26:22 +00:00
sprintfjs
storage Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
test-helpers Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
tests Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
transport Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
webconsole Bug 1749449 - [devtools] Cleanup hasNativeConsoleAPI state through the codebase. r=jdescottes,devtools-backward-compat-reviewers. 2022-01-11 15:17:24 +00:00
worker Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau 2021-11-17 12:43:26 +00:00
.eslintrc.js
accessibility.js
async-storage.js
async-utils.js Bug 1726237 - [devtools] Fix intermittent failures with error type getGrids failed r=jdescottes 2021-08-26 18:32:12 +00:00
constants.js Bug 1743347 - [devtools] Move whyPaused.* string to a ftl file in devtools/shared. r=bomsy,jdescottes,fluent-reviewers,flod 2021-12-02 07:10:27 +00:00
content-observer.js
debounce.js
defer.js
DevToolsUtils.js
dom-helpers.js
dom-node-constants.js
dom-node-filter-constants.js
event-emitter.js Bug 1709997 - [devtools] Add AbortController support to EventEmitter. r=jdescottes. 2021-07-12 07:13:13 +00:00
extend.js
flags.js
generate-uuid.js Bug 1602940 - Manual fixes to fix issues in files. r=Gijs,necko-reviewers,rpl,kershaw 2021-09-06 09:53:52 +00:00
indentation.js
indexed-db.js
jar.mn Bug 1531311 - [devtools] Add more visibility for node picker when debugging remote pages. r=jdescottes,devtools-backward-compat-reviewers. 2021-12-11 10:58:35 +00:00
l10n.js
moz.build Bug 1741369 - [devtools] Move all loader-related files to devtools/shared/loader r=ochameau 2021-11-17 12:43:26 +00:00
natural-sort.js
path.js
picker-constants.js
plural-form.js
protocol.js
system.js
ThreadSafeDevToolsUtils.js
throttle.js Bug 1737986 - [devtools] Replace lodash throttle usage with devtools/shared/throttle. r=ochameau. 2022-01-19 12:51:50 +00:00
validate-breakpoint.jsm Bug 1731967 - [devtools] Renamed all "watched data" to "session data". r=nchevobbe 2021-10-13 16:35:05 +00:00
wasm-source-map.js
webextension-fallback.html