1
所以我必须把信息输入到某个网站的表格中,我们将其称为websiteA。我必须在州的另一个网站上输入相同的信息,我们将其称为websiteB。在单独的网站上将表单字段数据从一种表单复制到另一种表单中?
我正在寻找一种方法来简化流程,并有从websiteA自动放置到匹配的表单字段上websiteB的信息。这只适用于我自己的电脑上的本地使用。
我是新来的过程,并一直在阅读有关不同的方式来做到这一点。我目前正试图在Tampermonkey做这件事,因为这似乎是我做一些研究的最佳选择。
到目前为止,下面是我的。作为一个例子,我只使用一个需要名称的表单域。元素的ID是name
。
// ==UserScript==
// @name Form Copier
// @namespace http://localhost
// @match https://websiteA.com
// @match https://websiteB.com
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
if(document.URL.indexOf("https://websiteA.com") >= 0){
window.open('https://websiteB.com'); //opens the destination website
document.getElementById("name").value = GM_setValue("name");
}
else if(document.URL.indexOf("https://websiteB.com") >= 0){
document.getElementById("name").value = GM_getValue("name");
}
这是目前我所拥有的,它根本无法正常工作。我试图寻找更好的方法来完成这件事,并没有任何运气。如果你们中的任何人都能帮助我,那将不胜感激。