Closed boromyr closed 3 months ago
Is this a script for greasemonkey or something? If you weren't aware, CS has it's own internal custom CSS injection through CS Options -> General -> User Styles if you need to apply custom styles.
All CS frames have been moved to the shadow DOM as of a few major release ago. The following code is what CS uses to find elements in the shadow DOM, You should be able to use similar code to find the iframe. That may depend on how your script is being injected though.
function getShadowRoot() {
let div = document.querySelector('contextsearch-widgets');
if ( div && div.shadowRoot ) return div.shadowRoot;
else return document.body || null;
}
getShadowRoot().getElementById('CS_quickMenuIframe');
It is a Tampermonkey script. I am familiar with custom CSS and use it, but I don't think it can be used to modify the CSS style of another element from a different extension. Thank you, I will try your function in the script!
Doing some housekeeping. Feel free to reopen this thread if the script I provided didn't fix your issues.
Hello, I am trying to apply a CSS style when the mouse hovers over the context search popup menu, but
document.querySelector('#CS_quickMenuIframe')
seems to find nothing, and it also returns null in the console.The original script works perfectly with
popup = document.querySelector('#prevue--wrapper');
, but I would like to make it work with CS as well, could you give me some advice?