what should my question title be ?
what should i write in the body ?
i am so mad … are they playing dump or something ?
i asked about 3 question on stack over flow about the same subject and still didn’t get a correct answer ?
I am not sure what you need to do and you are probably not using the best solution. Since you describe your requirements in the context of describing the solution it is difficult to understand the requirements. Beginners often think that regular expressions are the easiest solution then they have problems using regular expressions. See the following.
If you can state the requirements clearly without describing how you think it should be done then it is much more likely people will help. If it is a complicated requirement and you can describe it clearly then many people here are likely to enjoy the challenge.
if found where my problem relies … and couldn’t fix it correctly
<object type="text/html" data="http://page/" ></object>
let str = document.querySelector("body > script")
let pattern =/\bgetObj\("Frm_Logintoken"\)\.value = "([^"]+)";/;
the problem here is that the code works on the first page not the requested one .
if it was only possible to change from the top to 192.168.1.2 using code
here is what i want to do in details i want to make an auto login script in local level with a page that i can’t edit it’s code that have login token !
let’s say my page will be running on 192.168.1.5
and the other page is on 192.168.1.2
so my page should contain a code that is able to request the other page code and login to it .
this the curl login command … if it helps
curl "http://192.168.1.2/" --data "frashnum=&action=login&Frm_Logintoken=24&Username=adm1n&Password=admon"
Here is the source code of the other page.
and the regex that matches the login token getObj\("Frm_Logintoken"\).value = "(.*)"; console.log(test);
The line that has the login token value is at line 194 exactly
the username input area js path document.querySelector("#Frm_Username")
the password input area js path document.querySelector("#Frm_Password")
a function from the other page code that submits the login date function dosubmit()
i am not really sure if the login needed if i am not using curl
as it’s not a value that the user inputs .
the Frm_Logintiken is a token generated by the page and it basically increment by one on each successful login!
and i can’t use a proxy because mostly this will be local executed code .
i want that script to be able to work on phones browsers too
i hope i cleared this enough
If it is a complicated requirement and you can describe it clearly then many people here are likely to enjoy the challenge
Isn’t that what you were asking about in your other thread that didn’t work either? I’d suggest to tackle one problem at a time, otherwise you won’t even know if the issue is with your current code or the code it depends on…
The same-origin policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin. It helps isolate potentially malicious documents, reducing possible attack vectors.