Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
local host css/js file (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 authored May 21, 2022
1 parent b520178 commit 35e5662
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.DS_Store
src/.web-extension-id
cljs-src/resources/js/option.js
cljs-src/resources/js/pop.js
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ gooreplacer 最初为解决国内无法访问 Google 资源(Ajax、API等)

对于只想重定向 Google 资源的同学,可以在`在线规则`处填上

> https://raw.githubusercontent.com/jiacai2050/gooreplacer/master/gooreplacer.gson
> https://raw.githubusercontent.com/jiacai2050/gooreplacer/master/gooreplacer.json
然后点击更新就好了,目前会重定向到[loli.net的代理](https://u.sb/css-cdn/)
然后点击更新就好了,目前会重定向到[loli.net的代理](https://u.sb/css-cdn/)
如果想自定义规则,可参考 [guides.md](doc/guides.md)。实用小技巧:
- [自动跳转知乎链接](doc/guides.md#自动跳转知乎链接)
- [防运营商劫持](doc/guides.md#防止运营商劫持)
Expand Down
2 changes: 1 addition & 1 deletion cljs-src/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject gooreplacer "3.12.0"
(defproject gooreplacer "3.13.0"
:description "Modify, block URLs & Headers"
:url "https://github.com/jiacai2050/gooreplacer"
:license {:name "MIT"
Expand Down
10 changes: 10 additions & 0 deletions cljs-src/resources/css/antd.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cljs-src/resources/dev/ui/option.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<script src="http://localhost:8097"></script>
<script type="text/javascript" src="compiled-js/option/goog/base.js"></script>
<script type="text/javascript" src="compiled-js/option/cljs_deps.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/darkreader.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/antd.min.css">
<script src="js/darkreader.min.js"></script>
<meta charset="UTF-8">
<title>Gooreplacer</title>
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="init-option.js"></script>
<input type="file" id="gsonChooser" accept=".gson" style="display:none" />
<input type="file" id="jsonChooser" accept=".json" style="display:none" />
</body>
</html>
4 changes: 2 additions & 2 deletions cljs-src/resources/dev/ui/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<script src="http://localhost:8097"></script>
<script type="text/javascript" src="compiled-js/popup/goog/base.js"></script>
<script type="text/javascript" src="compiled-js/popup/cljs_deps.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/darkreader.min.js"></script>
<script src="js/darkreader.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css">
<link rel="stylesheet" type="text/css" href="css/antd.min.css">
<meta charset="UTF-8">
<title>Gooreplacer</title>
</head>
Expand Down
8 changes: 8 additions & 0 deletions cljs-src/resources/js/darkreader.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cljs-src/resources/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_appName__",
"version": "3.12.1",
"version": "3.13.0",
"description": "__MSG_appDesc__",
"default_locale": "en",
"permissions": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"chrome_style": false,
"open_in_tab": true
},
"author": "http://liujiacai.net",
"author": "https://liujiacai.net",
"homepage_url": "https://github.com/jiacai2050/gooreplacer",
"content_security_policy": "default-src 'unsafe-eval' 'self' https://cdn.jsdelivr.net http://localhost:8097; style-src http://* https://* 'unsafe-inline' 'unsafe-eval'; connect-src http://* http://localhost:* ws://localhost:* ; font-src https://*; img-src 'self' data:",
"manifest_version": 2
Expand Down
6 changes: 3 additions & 3 deletions cljs-src/resources/release/ui/option.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<link rel="shortcut icon" href="img/32.png" type="image/x-icon">
<link rel="icon" href="img/32.png" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/darkreader.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/antd.min.css">
<script src="js/darkreader.min.js"></script>
<title>Gooreplacer</title>
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="option.js"></script>
<input type="file" id="gsonChooser" accept=".gson" style="display:none" />
<input type="file" id="jsonChooser" accept=".json" style="display:none" />
</body>
</html>
4 changes: 2 additions & 2 deletions cljs-src/resources/release/ui/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<link rel="shortcut icon" href="img/32.png" type="image/x-icon">
<link rel="icon" href="img/32.png" type="image/x-icon">
<meta charset="utf-8">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/darkreader.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.css">
<script src="js/darkreader.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/antd.min.css">
<meta charset="UTF-8">
<title>Gooreplacer</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions cljs-src/src/gooreplacer/option/io.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(db/append-online-rules! r)))

(defn import-rules []
(let [file-choose (gdom/getElement "gsonChooser")]
(let [file-choose (gdom/getElement "jsonChooser")]
(set! (.-value file-choose) "")
(set! (.-onchange file-choose) (fn []
(let [file (aget file-choose "files" 0)
Expand All @@ -54,4 +54,4 @@
content (js/Blob. [(.stringify js/JSON (clj->js data) nil 2)] (clj->js {:type "application/json"}))]
(.download js/chrome.downloads (clj->js {:url (.createObjectURL js/window.URL content)
:saveAs true
:filename "gooreplacer.gson"}))))
:filename "gooreplacer.json"}))))
File renamed without changes.
File renamed without changes.

0 comments on commit 35e5662

Please sign in to comment.