There is a list on a website and I am trying it simulate a click on that list item. Normally, if I click the list item with the mouse, it gets selected.
The website is created with React. I can see it in React Dev Tools too.
I tried combinations of these on the <li> element:
$($0).click();
$($0).trigger('click');
$($0).mouseover();
$($0).trigger('mouseover');
$($0).mouseenter();
$($0).trigger('mouseenter');
What is the proper way of achieving it?
P.S: The website is 3rd party and I am trying to perform the click via chrome extension - content script (basically with injecting my script in a 3rd party page)
The website is Facebook Ads Manager > Traffic
Related
I am try to create a google extension which will allow me to click on buttons, based on id, with the help of google commands.
I can only find examples of using google commands with the background scripts which does not give me access to the actualy web page on the active tab. The key thing I want to achieve is this:
press Ctrl+Shift+0 and click a button based document query.
I have also thought of injecting content scripts, but that does not let me use the google command api to get shortcuts.
I am trying to integrate a screenshot tool or a Snipping tool kind of application inside a HTML page that I developed.
Basically the app should allow me to snipe a part of my current webpage and save it in picture format. Or it can even capture the entire page also. Anything works.
For the record, the content of my webpage contains an iframe whose source is - https://www.mathxl.com/info/exercise.aspx?fromask=yes&dataid=f919d33b-99fd-4fb5-90a8-a8a4c9894795
The Screen Capture Application should capture the dynamic contents that I insert inside the loaded iframe flash content as well.
Any kind of suggestions or information about a 3rd Party API (even paid version works) would be helpful.
PS - I tried HTML2Canvas.js, it didn't work.
I'm using ESRI's ArcGIS Web App to create a map that has several interactive features. By clicking on specific objects in my map, users will see a pop up (created using the Web App creation features) with information about the area they clicked on.
Some of those pop ups contain a link that should open up a new window to display an image (that I have hosted on my web server).
Here's where my problem begins. In the map builder, inside my ArcGIS online login where I set everything up, I have added the link control to the configured popups that tells it to use Javascript in an "onclick" to tell it to open a new window, of a specific size, and where to find the image to display. It all works fine in the builder. But as soon as I create the web app, it completely drops my "onclick".
And more-so, I tried to work around this by changing the href of the link to "javascript:myScriptHereTellingItToOpenANewWindow" and the web app then drops the "javascript:" part and changes it to "#" thus still not working when I click it, all it does is try to open a new browser tab and ignores the rest of the script written in the href.
I'm sorry I have to be somewhat vague because this is for a company project that has high security. Below is what little code I can share (cleaned up a little to hide confidential information).
In the ArcGIS Web Map builder, here is the code I have in my configured popup:
<a onclick="window.open('URL of image file I want to load','width=1000,height=202,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');" style="cursor:pointer;" target="_parent">View Featured Line</a>
And as I said, that works fine in the editor. But once I chose to "Create a Web App from this map" it drops the "onclick" completely.
If I put it in the href tag, like below:
View Featured Line
Then when I "inspect source" in the web app, it looks like this (which doesn't work either):
View Featured Line
I need to navigate through a particular website, frequently, to get at some sub-page that is several layers beyond the front page and it is taking too much time to click and scroll and click and scroll to get at the desired final screen where I enter the search string. So, I would like to automate the process by making Javascript trigger the right button events to get me to the distant page where I can enter the search string manually.
So, I know how the code needed to trigger the event,
document.getElementById('x').click();
but how can I implement this inside my browser, since this is not my own website?
If this is going thru different pages, then probably a Web UI automation tool would be the best (like Selenium - http://www.seleniumhq.org).
as #elcarns says, if you need to inject code into another's website, you could do so opening the console (view --> developers --> javascript console in Chrome).
Another, more complex way to do it when you have to traverse several pages is by developing a plugin.
javascript:document.getElementById('x').click(); in the url bar. You can probably make a bookmarklet for it as well.
I have developed a simple application with Google maps (API 3). This application loads a store's menu dynamically, so if the user click's a store item, the map shows the specific location of the store.
For that I have applied "Asynchronously Loading" from the Developer's guide, it works perfectly, but I'am concern that every time the user click a store item (with out reloading the page), a script tag in the body is inserted.
Is it possible to have further problems because of that, performance , anything ?