Question: Access document object in my contentScriptInjection in js

Question

Access document object in my contentScriptInjection in js

Answers 0
Added at 2016-12-25 04:12
Tags
Question

I am trying to build a chrome-extension, that modifies a viewed page. Accessing its elements like $("body") isn't a problem, but since I want to use the querySelectorAll, I need the document-object. And I've tried things like

var itemElements = $(document).querySelectorAll(".featured-item");

but it simply doesn't work. If I do it directly on the site via console, it works.

EDIT: By now I've figured it out. its by using only:

    var itemElements = document.querySelectorAll(".featured-item");
Answers to

Access document object in my contentScriptInjection in js

Source Show
◀ Wstecz