简体   繁体   English

单击按钮打开新标签页后继续 JavaScript

[英]Continue JavaScript after open new Tab via Button Click

I'm quiet new to JavaScript and need your help concerning the following problem: I've written a JavaScript to subscribe automatically to a gym class every monday at 7 am.我是 JavaScript 的新手,需要您帮助解决以下问题:我已经写了一个 JavaScript,每周一早上 7 点自动订阅健身房 class。 I have to click a button that's opening a new tab where I have to fill my personal data.我必须单击一个打开新选项卡的按钮,我必须在其中填写我的个人数据。 The URL of the new tab is variable so I cant do it via新选项卡的 URL 是可变的,所以我不能通过

 window.open(URL,"_self")

Is there a way to continue the script in the new tab or open the website in the same tab?有没有办法在新选项卡中继续脚本或在同一选项卡中打开网站?

Thanks!谢谢!

Because of the objections mentioned, that doesn't sound feasible to me - at least in this form.由于提到的反对意见,这对我来说听起来不可行 - 至少在这种形式下。 If you want to run a script on the external website, then simply use a browser solution such as:如果你想在外部网站上运行脚本,那么只需使用浏览器解决方案,例如:

There you can install your script and have it automatically fill out your registration.在那里你可以安装你的脚本并让它自动填写你的注册。

If you want to automate this completely without doing anything on your part, then you will not be able to avoid an (external server-side) solution such as a NodeJS application with puppeteer ( https://github.com/puppeteer/puppeteer ) running every X days.如果您想在不做任何事情的情况下完全自动化,那么您将无法避免(外部服务器端)解决方案,例如带有 puppeteer 的 NodeJS 应用程序 ( https://github.com/puppeteer/puppeteer )每 X 天运行一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM