Adblock在React JS上摧毁了我的网站(Adblock块所有提取和Axios请求)

发布于 2025-01-17 09:54:12 字数 989 浏览 0 评论 0原文

我对React JS进行了一个课程项目,并将其上传到托管。在我将网站发送给朋友之后,他说,无论是永恒的下载,还是网站都没有返回验证结果,以及其他网站,几乎没有任何作用。当我开始理解时,我意识到他的错误“无法加载资源:net :: err_blocked_by_client”,在禁用Adblock扩展程序后,该站点的所有功能开始正常工作。在我的问题中,毫无疑问的琐事,例如阻止图像,绝对对服务器的所有请求都会阻止我。我的网站的设计使得在正面只有一个视觉和要求的请求,在背面,所有用户操作都被处理并返回结果,前面的动作依赖于该操作,您可以自己看到,“ site “我在客户端的控制台上有恒定的错误,当您禁用时,广告阻滞剂,一切都开始工作。我的代码很大,但是如果您怀疑某些特定的代码部分,那么我可以提供它们。 以下是对服务器的常用请求之一,其中大多数是,还有几个Axios请求,但是其中很少,但也被阻止了。我还在其他线程上看到了AJAX请求的类似问题,但是我从未看到过所有块的特定原因。

        var form = new FormData()
    form.append('JSONPARSE',true);
    fetch("http://g908020p.beget.tech",{
        method: 'POST',
        body: form
    })
    .then(response => response.text())
    .then(response => {
        var json = JSON.parse(response)
        setCatalog(json.items)
        setLoading(true)
        console.log(json)

    })
    .catch(error => {
        console.log(error)
    })

I made a course project on React JS and uploaded it to the hosting. After I sent my site to a friend, he said that almost nothing works for him, either eternal downloads, or the site does not return validation results, and others. When I started to understand, I realized that he had errors "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT", after disabling the Adblock extension, all the functionality of the site began to work properly. In my question, there is no question of trifles, such as blocking images, absolutely all requests to the server are blocked for me. My site is designed so that on the front there is only a visual and requests for the back, and on the back, all user actions are processed and the result is returned, on which the actions of the front depend, you can see for yourself, "site" that I have constant errors in the console on the client side, and when you disable the ad blocker, everything starts working. My code is quite large, but if you have suspicions about some specific code sections, then I can provide them.
Below is one of the usual requests to the server, most of them are, there are a couple more axios requests, but there are very few of them, but they are also blocked. I also saw similar problems with ajax requests on other threads, but I never saw a specific reason for all the blocks.

        var form = new FormData()
    form.append('JSONPARSE',true);
    fetch("http://g908020p.beget.tech",{
        method: 'POST',
        body: form
    })
    .then(response => response.text())
    .then(response => {
        var json = JSON.parse(response)
        setCatalog(json.items)
        setLoading(true)
        console.log(json)

    })
    .catch(error => {
        console.log(error)
    })

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠檬色的秋千 2025-01-24 09:54:12

是的,与

我使用包裹我的请求的第三方服务器作弊。
检查一下:
https://codetabs.com/cors/cors/cors-proxy/cors-proxy/cors-proxy/cors-proxy.html

  fetch("https://api.codetabs.com/v1/proxy?quest=http://g908020p.beget.tech")

当然,您可以用自己的服务器包装它。

Yes, related to this post, the adblock parses the URL for some pattern.

I cheated this by using a third party server that wrapped my request.
Check it out:
https://codetabs.com/cors-proxy/cors-proxy.html

  fetch("https://api.codetabs.com/v1/proxy?quest=http://g908020p.beget.tech")

Of course you can wrap it with your own server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文