dperini / nwsapi

Fast CSS Selectors API Engine
MIT License
105 stars 37 forks source link

I am trying to create a shadowRoot pseudoClass or operator, but nothing works. #61

Closed FabricioTeran closed 1 year ago

FabricioTeran commented 2 years ago

Trying with this code, but returns a void array:

NW.Dom.registerSelector('shadow', /\:(shadow)/i, (function(global) {
    return function(match, source, mode, callback) {
        source = 'e=e.shadowRoot;' + source;
        return { 'source': source, 'status': true };
    }
})(this));
console.log(NW.Dom.select("body page-1:shadow footer", document));
FabricioTeran commented 2 years ago

If you can help me would be really helpfull, i don't find any documentation of your api.

dperini commented 1 year ago

@FabricioTeran it seems you are using it correctly. However if you haven't solved your problem yet I might help on this. You can write to me directly or we can arrange a chat if you like.

I am now closing this because it's not an issue.