Simulate click in web.whatsapp.com - javascript

My mission is export my whatsapp contacts with profile picrures.
So I decided to make a chrome extension for this purpose.
And Here to collect phone of each I have to click them. And each time go back to contact list I guess. The button I got a problem to click on by javascript code is
I need to click on this button by code and get full contact list
I can find this elem by query like
$('.menu-horizontal span .menu-horizontal-item:nth-child(2)')
But when I tried to click on this element - nothing happens
$('.menu-horizontal span .menu-horizontal-item:nth-child(2)').click()
Any ideas... please!!!!. I just need to open contacts panel each time!!
I have added and used jquery but It's ok to use vanilla JavaScript

I'm using simulating click function in my extension - https://gist.github.com/davojta/3647dfbf006bec75f6ef7e3f8d2f3e70

Related

JS form action link is used instead of link that is actually clicked

I just came accross the below issue in a project of mine:
user clicks a button
a js function is called to check the
input of the form field and if accepted will submit the form to save_to_db.php in an
iframe.
in the iframe, save_to_db.php will save the form details to the db and calls another js function that updates the contents of html elements on the current page showing the latest status.
This used to work without any issues (and still does in most browsers).
But now in Chrome Mobile browser version 63.0.3239 somehow every link a user clicks after they clicked the button, will load to save_to_db.php (the form action of the button) instead of the link that is clicked.
Has anyone noticed this or similiar behaviour or does anyone know how to resolve this?

Run a Shortcode from a Button in Visual Composer - Wordpress

This should be a fairly obvious thing to be able to do. I have a plugin that has a modal newsletter signup form. I am very happy with the plugin and it has a number of options for the way it launches (after x seconds, when user reaches bottom of screen etc) it also has a manual launch option which gives me these following codes.
My theme uses Visual Composer. I want to launch the popup manually when a site user clicks a button on the homepage. I thought this would be simple but apparently not. The options I have with the standard VC button is shown below; I have tried numerous options of adding classes to the button but I cannot add a shortcode or class to any of the fields to launch the modal. I know there is a javascript onClick function but I'm not very good with Javascript. There must be a simple way to click a button and open a modal, maybe I am overlooking something completely obvious.
OK after reading back my question I thought about adding a custom css class to the button field Extra Class Name and it works. I thought that the extra class name here was for styling the button itself and did not realise that this would also trigger the pop-up as well. Guess I should have checked that first.

Selenium Python - How to get class id by clicking on it manually

I'm trying to click on a button on a page that has a lot of JavaScript but no matter what I try, can't click it. Is there a way for me to click the button manually and get what I need to click?
I've tried inspecting elements and FirePath but those aren't giving me the correct class or id that I need to click
Edit: This is what I'm trying to accomplish, the below is from Selenium IDE firefox plugin
Command Target
open /logger/summary.ftl
clickAndWait link=System Admin
selectFrame sysadmin-content
click //div[#id='sysadminmenu__sysadminmenu_x-auto-29']/span[3]/span
click id=x-auto-178
You may try
http://www.seleniumhq.org/projects/ide/
This has a feature to find web element path

How to hide a container when a button is clicked and make a form appear?

So I'm trying to make a store for computers and I'm making a webshop for it, but I ran into a problem.
Now I have a container, and I want it to hide it's content when i click a button, and then a form needs to appear with name, email and a textrea for what they want to buy..
but if they click anywhere on page, other then the button I want to bring the old content back!
I'm building this in a program called Wakanda Studios, i don't know if this helps, but I'm sure someone will find my answer.
Quick note: I don't have any code yet, other then my container!
Try this, it is written in jQuery so you will have to add jQuery to your page by putting
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> in the document head and then adding the following code at the end of your page...
$(document).ready(function(){
$("#button-id").click(function(){
$("#container-id").hide();
$("#form-id").show();
});
$(document).click(function(){
$("#container-id").show();
$("#form-id").hide();
});
});
All you will have to now is add the ID attribute to the button which starts everything off, the container, and the form.
If you are using the WAF framework of Wakanda and Studio, you would select your button, go to the events tab and add an on click event.
This will stub in a wrapper for the code to execute on click.
To hide a container, you need the container id. Using this you create a Wakanda reference to the widget and use the "hide()" method.
$$('yourContainerId').hide();
JQuery would work as well.

how can i fill text into facebook plugin comment by clicking the button using javascript

Is there a method to fill the textfield from a Facebook comment plugin using javascript?
I know how to fill the text into textbox of website using active control by javascript, but it doesn't seem to work on the Facebook comment plugin.
eg. if I click the hello button I want to fill the active textbox text with "hello".
You will need to make sure that you execute your action after the textfield appears in your UIWebView. However, I will highly recommnend making a delegate method instead, detecting the facebook button click, and use the Facebook SDK instead.
Much more freedom instead of having to "hijack" the html and manipulate it after load.

Categories

Resources