Hi, I am new here, and I was looking forward to finding someone to help me …
I want to control any website automatically via the webview, and I have done the search and succeeded in completing the following …
Use this code to click on the item
Use this code to focus on Textbox
This is to enter a value for Textbox
But when I use the last code, that is the result
The text is just as floating.
And when I click post, it gives me a notification that there is no text
I tried a lot and tried more than one java script code …
Also, I tried to focus first on Textbox and then do that step, but there was no result
And I tried to focus, then press Paste from the keyboard … and it worked ,
But I want to control it automatically from the blocks
I need help ,plz
1 Like
vknow360
(Sunny Gupta)
April 8, 2021, 2:06pm
#3
I recommend to use id instead of class name.
Hi everyone
Since I am getting a lot of questions related to CustomWebView extension so I decided to create a guide to show how we can do various tasks with the extensions in different parts.
Use JavaScript functions (also for webviewer)
1.Create and Set Webview
As we know that to use the extension we have to create and make a webview active which can be done in following way:
[image]
Since JS is by default enabled in extension so there is no need to set it manually. …
1 Like
But in facebook for example , no id for use …
That is why I am using Class name …
The problem is that everything (Click and Focus Events) works except the text box ( Value Event )
There is no other solution?
vknow360
(Sunny Gupta)
April 9, 2021, 4:03pm
#5
Can you show a screenshot of inspect element?
Yes Sure
when i used id in facebook ( id=“uniqid_1” ) , i had nothing
and i blogger , no id to use …
vknow360
(Sunny Gupta)
April 10, 2021, 3:36am
#7
Was your query like this?
document.getElementById("uniqid_1").value = "value to set";
You can also try:
Use the last line in another block, except switch “.value” with “.placeholder” and the string to an empty string.
hammerhai:
placeholder
i tried this with class name & id , but not working
vknow360
(Sunny Gupta)
April 11, 2021, 1:23am
#11
@hammerhai meant this:
document.getElementById("uniqid_1").placeholder = "value to set";
hammerhai
(Nathan)
April 11, 2021, 2:02am
#12
Sorry for keeping you waiting for a response. Try typing something into the textarea yourself and then take another screenshot of the elements tab.
Thanks (:
vknow360
(Sunny Gupta)
April 11, 2021, 8:04am
#14
Then read @hammerhai 's previous post.
hammerhai
(Nathan)
April 11, 2021, 7:02pm
#16
Yes! Now just repeat the same process for Facebook and we can continue from there.
hammerhai
(Nathan)
April 12, 2021, 3:18am
#18
I should’ve been more clear @Sara_Wilson , I need you to type in the textarea of Facebook, then take a screenshot of the elements. My apologies.
1 Like
The value that I set is now on the line in the second box
However, this line does not contain an ID or Class Name
hammerhai
(Nathan)
April 13, 2021, 11:29pm
#20
Use this as your replacement for setting the text in that field…
var statusInput = document.querySelector('input[data-sigil=" mentionsHiddenInput"]');
if (statusInput != typeof undefined || statusInput != null) {
var isStatusInputHidden = statusInput.hidden
var statusInputName = statusInput.name
if (isStatusInputHidden && statusInputName != typeof undefined && statusInputName == "status") {
statusInput.value = "Your text"
}
}
Yes I know it’s a lot, however most of it is for validating to make sure we’re actually changing the correct field. Let me know if it works!
1 Like