Closed xyngfei closed 1 year ago
Hello,
You can use the following code to get the page url:
return function() {
return document.location.toString();
}
If you need to access elements from window
or document
objects that belong to the page you are browsing, you will need to return a function (as in the example above). You can find out more about this at the link below:
https://docs.fakedata.pro/writing-code/run-in-content-script.html
Thanks!
@haterapps thx for your suggestion, it works perfectly fine. however, if I am trying to build-in JS lib, it cannot work again.
return function() {
return document.location.toString(); + moment().format("yyyyMMDD");
}
let's say I have the site https://mdbootstrap.com/docs/react/forms/input-fields/
put the custom script for id=form1 textbox to return the current UR
return document.location.toString()
However, when I tried to generate random test data, it does not show the current URL, any idea?