AutoPager

⭐Append the next page content to the bottom seamlessly (like a waterfall, Unlimited scrolling, no need to manually click on the next page) ⭐, support various forums, social networking, games, comics, novels, academics, search engines (Google, Bing, Yahoo...) and other websites~

< Feedback on AutoPager

Review: Good - script works

§
Posted: 22.09.2022

网址: 美女图片-宅男女神

大佬请问这样写规则有啥问题,翻页的时候会报错: Refused to connect to "https://m.fnvshen.com/gallery/2.html": URL is not a part of the @connect list;

      "宅男女神_m_gallery": {
        "host": ["m.gnvshen.com"],
        "url": "return (location.hostname.indexOf('m.')===0 && fun.indexOF(/\\/gallery\\//))",
         "pager": {
           "nextL": ".next",
           "pageE": "#gallerydiv",
           "replaceE": "#pagediv",
          "scrollD": 2000
      }
    }
§
Posted: 22.09.2022

感觉像是跨域了,请问如何解决呀,先谢过大佬了。

X.I.UAuthor
§
Posted: 23.09.2022

是这个网页的问题,网站改域名后,只是做了个域名重定向,但并没有替换网页中的各链接内的域名。

你访问的是 m.gnvshen.com,但是各链接用的都是 m.fnvshen.com 域名。
而浏览器是禁止 xhr 跨域访问的,因此才会报错。


这种情况,要么把 m.fnvshen.com 域名加到脚本的 xhr 域名白名单中,要么就需要对 nextL 规则优化,来手动替换域名。

前者则是:
编辑脚本页面,左上角选项卡中选择 [设置],翻到下面找到 XHR 安全 - 用户域名白名单,添加 m.fnvshen.com 域名,然后在你写的翻页规则中加入 "history": false, 来禁用添加历史记录及修改 URL 地址(因为域名不一样,修改 URL 地址会报错),即如下:

    "宅男女神_m_gallery": {
        "host": "m.gnvshen.com",
        "url": "/^\\/gallery\\//",
        "history": false,
        "pager": {
            "nextL": ".next",
            "pageE": "#gallerydiv",
            "replaceE": "#pagediv",
            "scrollD": 2000
        }
    }

后者则是:

    "宅男女神_m_gallery": {
        "host": "m.gnvshen.com",
        "url": "/^\\/gallery\\//",
        "pager": {
            "nextL": "js;let n=fun.getCSS('a.next');if(n && n.href) return n.href.replace('m.fnvshen.com','m.gnvshen.com')",
            "pageE": "#gallerydiv",
            "replaceE": "#pagediv",
            "scrollD": 2000
        }
    }
§
Posted: 23.09.2022

好的,谢谢大佬解答。

Post reply

Sign in to post a reply.