I'm creating Chrome extension and I need to get any elements from page which created on flutter. I see at the devtool one canvas element as a whole page. So I can't use document.querySelector() as usual.
How can I get element from page and get properties of that element by js at my own script?
Related
I'm trying to use Selenium in Python to send sms using my Dlink DWR-921 router. But I can't select any element on the document. I tried td, table, body but none of them works. I also tried on browser javascript for the above elements as well. Using document.getElementsByTagName(), but I get empty HTMLCollection. May I know why the element in the page is not selectable?
Update: To ensure the dom last been properly and fully loaded. I took a screenshot and confirmed that the DOM has been loaded everytime it run.
Router model: DLink DWR-921
SW Version: V01.01.3.016
Try to look for an input tag.
Also, it may be that the elements are inside an Iframe. Selenium doesn't "know" how to locate elements inside iframes, so you need to tell me to go into the iframe:
driver.switchTo().frame("firstframe");
or
driver.switchTo().frame(0);
I'm working on a chrome extension that will inject a content script only on a certain pages.
I'm using vue.js and I want to access some DOM elements of the pages, how I can achieve this?
Normally in jQuery I will have $('.selector') to access a dom element, but in this case I can't assign refs or any other id to the DOM elements I want to access. will getElementById work or there is another way?
I'm having some issues with the removal of a polymer element from my web page.
I've build a carousel via an unordered list which list items contain content. Some of this content is simple HTML, some are images, some are videos and some are polymer elements.
Every now and then, the <ul> gets cleared via a jQuery .empty() command.
The issue I'm facing is that the polymer elements don't appear to be cleared correctly.
Inside the polymer elements are timeout events that retrieve content(xml and images) every now and then. When investigating the network load in the chrome developer tools AFTER the polymer element has been removed from the page, you can still see the xml and images being loaded every now and then. So aparantly, a part of the polymer element is still active, most likely somewhere in the shadow-dom.
How do I properly remove an embedded polymer element and everything associated with it from my webpage?
I think setTimeout is not defined within the scope of your element but in global scope.
So you must use clearTimeout function in lifecycle detach function in your element to cancel existing timeouts.
I'm developing a Chrome extension that modifies a page's DOM to add extra functionality on page load. After the page loads and I'm done manipulating the DOM, one of the functions that is available to the user is a button that reads all of the text on the page and manipulates it.
My issue is that when I try to iterate through the DOM, there's a lot of objects and text that was added by my extension on page load. I only want this function to iterate through the DOM as it was originally.
Is it possible to save the state of the DOM on page load to use later on?
Let's say I have a page with an iframe and within the iframe I have some ckeditor inline instances that I want to manage from the containing page.
From the parent, if I run
console.log(document.getElementById("iframe_id").contentWindow.CKEDITOR);
I have the CKEDITOR object, but don't know why, if I run
console.log(document.getElementById("iframe_id").contentWindow.CKEDITOR.instances);
i get an "undefined" result.
Any idea?
POST EDIT: if I run the last console.log directly in the inspector I get all the instances as normal, the problem seems to exist only in the parent page js.