- 积分
- 636
- 最后登录
- 2021-4-13
- 精华
- 0
- 阅读权限
- 40
- 主题
- 65
- UID
- 1292031
- 帖子
- 1094
- PB币
- 492
- 威望
- 33
- 贡献
- 0
- 技术
- 1
- 活跃
- 1090
  
- UID
- 1292031
- 帖子
- 1094
- PB币
- 492
- 贡献
- 0
- 技术
- 1
- 活跃
- 1090
|
本帖最后由 ngbanyan 于 2021-1-1 20:35 编辑
一个临时性、无大用的 TM 脚本用于修正 https 协议访问本站时的页面显示和 js 运行错误
PCBETA 终于用上 HTTPS 了!!!
- // ==UserScript==
- // @name ★ bbs.pcbeta.com
- // @namespace All website Scripts
- // @version 0.1.0
- // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
- // @match https://*.pcbeta.com/*
- // @run-at document-start
- // ==/UserScript==
- (function($) {
- $('head').prepend('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">');
- $(function() {
- $('link, script, base, a, img').each(function() {
- let c;
- if (c = $(this).attr('href')) {
- $(this).attr('href', c.replace(/http:/, 'https:'));
- }
- if (c = $(this).attr('zoomfile')) {
- $(this).attr('zoomfile', c.replace(/http:/, 'https:'));
- }
- if (c = $(this).attr('file')) {
- $(this).attr('file', c.replace(/http:/, 'https:'));
- }
- if (c = $(this).attr('src')) {
- $(this).attr('src', c.replace(/http:/, 'https:'));
- }
- });
- });
- })($);
复制代码
|
-
1
查看全部评分
-
|