javascript 注入_如何注入JavaScript代码以自动操作网站

本文介绍了如何使用Google Chrome扩展自定义JavaScript for Websites自动注入代码,以隐藏烦人的弹出窗口。通过识别DOM元素,创建并测试注入代码,解决代码无效的问题,以及分享更多利用此技术实现的功能。
摘要由CSDN通过智能技术生成

javascript 注入

As developers and users of the internet, we often come across websites that display many pop-ups, from subscription requests to paywalls, advertisements to notifications, and so on.

作为Internet的开发人员和用户,我们经常会遇到显示许多弹出窗口的网站,从订阅请求到付费专区,从广告到通知,等等。

Many times, we use those websites daily for all kinds of things, and seeing those pop-ups over and over gets old!

很多时候,我们每天都使用这些网站来处理各种事情,并且看到这些弹出窗口一遍又一遍变得陈旧!

Developers can get around these by going to the console and finding selectors to manipulate the website's document object model (DOM) by adding or modifying CSS or JavaScript.

开发人员可以通过转到控制台并找到选择器来解决这些问题,这些选择器可以通过添加或修改CSS或JavaScript来操纵网站的文档对象模型 (DOM)。

But now, thanks to Google Chrome and its extension store, anyone can inject code into any website automatically. We'll go through to the process step by step in this small guide.

但是现在,借助Google Chrome及其扩展商店,任何人都可以将代码自动注入任何网站。 我们将在本小指南中逐步介绍该过程。

1.安装扩展以注入代码 (1. Installing the Extension to Inject the Code)

The following only applies if you use Google Chrome. Install the extension custom JavaScript for websites. This small extension allows you to run JavaScript on any website automatically, and it saves the code for future visits in your web browser.

以下仅适用于使用Google Chrome浏览器的情况为网站安装扩展

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值