Bug 1524097 - Devtools Inspector doesn't show any nodes (besides <html>) for LinkedIn pages r=rcaliman

I would have thought that the anonymous node fix would also have fixed this but we have had to manually add the before and after pseudo elements.

Differential Revision: https://phabricator.services.mozilla.com/D18536

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Ratcliffe 2019-02-04 16:57:10 +00:00
parent c39a332eaa
commit 7dce60ec8b

View File

@ -10,7 +10,11 @@
const { Cu } = require("chrome");
const Services = require("Services");
const makeDebugger = require("devtools/server/actors/utils/make-debugger");
const { isAnonymous } = require("devtools/shared/layout/utils");
const {
isAfterPseudoElement,
isBeforePseudoElement,
isNativeAnonymous,
} = require("devtools/shared/layout/utils");
// eslint-disable-next-line
const JQUERY_LIVE_REGEX = /return typeof \w+.*.event\.triggered[\s\S]*\.event\.(dispatch|handle).*arguments/;
@ -347,9 +351,10 @@ class JQueryEventCollector extends MainEventCollector {
const jQuery = this.getJQuery(node);
const handlers = [];
// If jQuery is not on the page or if this is an anonymous node we need
// to return early.
if (!jQuery || isAnonymous(node)) {
// If jQuery is not on the page, if this is an anonymous node or a pseudo
// element we need to return early.
if (!jQuery || isNativeAnonymous(node) ||
isBeforePseudoElement(node) || isAfterPseudoElement(node)) {
if (checkOnly) {
return false;
}