├── .gitignore ├── index.css ├── package.json ├── README.md ├── gulpfile.js ├── LICENSE ├── dist ├── whynotoib.min.js └── whynotoib.min.js.map ├── test.html ├── index.html └── whynotoib.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /index.css: -------------------------------------------------------------------------------- 1 | .ui.container { 2 | margin-top: 5vh 3 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "@babel/core": "^7.4.0", 4 | "@babel/preset-env": "^7.4.1", 5 | "gulp": "^4.0.0", 6 | "gulp-babel": "^8.0.0", 7 | "gulp-concat": "^2.6.1", 8 | "gulp-sourcemaps": "^2.6.5", 9 | "gulp-uglify": "^3.0.2" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Why Not OIB? 2 | 3 | ``` html 4 | 5 | ``` 6 | 7 | That's it. 8 | 9 | Still in development (but maybe usable). 10 | 11 | 12 | See our [site](https://librehs.github.io/whynotOIB/) (Chinese) for the reasons. 13 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const babel = require('gulp-babel'); 3 | const uglify = require('gulp-uglify'); 4 | const concat = require('gulp-concat'); 5 | const sourcemaps = require('gulp-sourcemaps'); 6 | 7 | gulp.task('default', () => 8 | gulp.src('whynotoib.js') 9 | .pipe(sourcemaps.init()) 10 | .pipe(babel({ 11 | presets: ['@babel/env'] 12 | })) 13 | .pipe(uglify()) 14 | .pipe(concat('whynotoib.min.js')) 15 | .pipe(sourcemaps.write('.')) 16 | .pipe(gulp.dest('dist')) 17 | ); 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 LibreHouse 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /dist/whynotoib.min.js: -------------------------------------------------------------------------------- 1 | "use strict";!function(){var e=!1,i=navigator.userAgent,o=[/(M|m)icro(M|m)essenger/,/TIM\//,/QQ\//],r=["WeixinJSBridge"];if(function(){for(var n=r,e=0;e\n#whynotOIB {\n transition: opacity .3s ease-in-out;\n top: 20px; \n width: 85%; \n position: fixed; \n opacity: 0;\n left: 7.5%;\n border: dashed 1px;\n background: white;\n text-align: center;\n z-index: 31;\n}\n\n#whynotOIB.oibDisplay {\n opacity: 1\n}\n\n#whynotOIB.noTrans {\n transition: none;\n}\n\n#whynotOIB .grey {\n color: grey\n}\n\n\n
\n

你好。

\n

为什么不试试用你的浏览器(而不是微信)访问这里呢?

\n

点击右上角的三个点,然后选择“在浏览器中打开”。

\n

这能更好地保护你的隐私,也许还能更好地保护互联网。

\n

[为什么?] [立即隐藏]
\n (我们会在显示7秒后自动隐藏。)

\n
\n',document.body.appendChild(n),setTimeout(function(){document.getElementById("whynotOIB").className="oibDisplay"},1e3),setTimeout(function(){s(!1)},8e3),document.getElementById("hideOIBRegBox").addEventListener("click",function(){s(!0)}),e=!0}}function s(){(!(0 2 | 3 | 4 | 5 | 6 | 7 | 8 | Tests | WhyNotOIB 9 | 10 | 11 | 12 |
13 |

这是一个测试页面。

14 |
15 | 未检测到相关浏览器。 16 |
17 |
18 | 19 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 请让真正的浏览器去做浏览器要做的事情 | WhyNotOIB 9 | 10 | 11 | 12 | 13 | 14 |
15 |

Why Not OIB?

16 |

让专业浏览器做浏览器的事情,何乐而不为?

17 | 18 |

这是什么?

19 |

这是一个由社区维护的脚本项目,希望通过一些方式呼吁用户减少对定制性浏览器(如微信自带的浏览器)的依赖。

20 | 21 |

有什么理由不用定制性浏览器呢?

22 |
23 |
某些定制浏览器支持的 HTML5 特性不够全面。
24 |
网站保留在这些定制浏览器上的 Cookie,可能被用来追踪用户,以向用户发送针对性的广告并/或使用户的隐私受到侵犯。
25 |
定制浏览器可能会阻碍用户访问开放的互联网。
26 |
定制浏览器本身的设计可能使其不适合作为浏览器使用。
27 |
以及其它...
28 |
29 | 30 |

我是网站的站长,如何参与?

31 |

首先很抱歉在很后面的位置才放置这个标题,因为这个页面也会呈现给通过浮动窗口访问此网站的用户。

32 |

其实很简单。在您的网站加入这段代码即可:

33 |
34 |

<script src="https://cdn.jsdelivr.net/gh/librehs/whynotoib@master/dist/whynotoib.min.js"></script>

35 |
36 |

由于本页面所在的 GitHub Pages 被部分定制浏览器封锁,基于您的需求,您可能需要在自己的站点放置此页面并修改 Javascript 文件的对应位置。

37 | 38 |
39 | A LibreHouse Project / GitHub / LibreHouse <3 Open Internet 40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /whynotoib.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | (function () { 4 | 5 | // Constants 6 | let page = ` 7 | 33 | 34 |
35 |

你好。

36 |

为什么不试试用你的浏览器(而不是微信)访问这里呢?

37 |

点击右上角的三个点,然后选择“在浏览器中打开”。

38 |

这能更好地保护你的隐私,也许还能更好地保护互联网。

39 |

[为什么?] [立即隐藏]
40 | (我们会在显示7秒后自动隐藏。)

41 |
42 | ` 43 | 44 | let haveDone = false; 45 | let ua = navigator.userAgent; 46 | let uaList = [ 47 | /(M|m)icro(M|m)essenger/, 48 | /TIM\//, 49 | /QQ\// 50 | ]; 51 | let objectList = [ 52 | "WeixinJSBridge" 53 | ] 54 | let eventList = [ 55 | "WeixinJSBridgeReady" 56 | ] 57 | 58 | // Execution 59 | 60 | if (searchObject() || searchUa()) { 61 | showOIB(); 62 | } else { 63 | for (let i of eventList) document.addEventListener(i, () => { showOIB(); }) 64 | } 65 | 66 | // Functions 67 | 68 | function searchObject() { 69 | for (let i of objectList) { 70 | if (window[i]) return true; 71 | } 72 | return false; 73 | } 74 | 75 | function searchUa() { 76 | for (let i of uaList) { 77 | if (ua.search(i) !== -1) return true; 78 | } 79 | return false; 80 | } 81 | 82 | function showOIB() { 83 | if (haveDone) return; 84 | let elem = document.createElement("div"); 85 | elem.innerHTML = page; 86 | document.body.appendChild(elem); 87 | setTimeout(() => { document.getElementById('whynotOIB').className = "oibDisplay"; }, 1000); 88 | setTimeout(() => { hideOIB(false); }, 8000); 89 | document.getElementById('hideOIBRegBox').addEventListener('click', () => { hideOIB(true) }); 90 | haveDone = true; 91 | } 92 | 93 | function hideOIB(sudden = true) { 94 | if (sudden) { 95 | document.getElementById('whynotOIB').className = "noTrans"; 96 | } 97 | document.getElementById('whynotOIB').className = ""; 98 | } 99 | })() 100 | -------------------------------------------------------------------------------- /dist/whynotoib.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["whynotoib.js"],"names":["haveDone","ua","navigator","userAgent","uaList","objectList","page","document","hideOIB","_arr2","getElementById","window","i","_arr3","_i4","length","search","searchUa","showOIB","_i","_arr","addEventListener","elem","createElement","innerHTML","body","appendChild","setTimeout","className","arguments","undefined"],"mappings":"AAAA,cAEA,WAyCI,IAAIA,GAAW,EAmCXC,EAAOC,UAAPC,UACHC,EAAA,CAjCG,yBAmCJ,QACQJ,QAEAK,EAAaC,CACjBC,kBAG2EC,GAK3E,WACID,IADQ,IAAAE,EACCC,EAATH,EAAAA,EAAAA,EAAAA,EAAAA,OAAAA,IAAwB,CAAxBA,IAASG,EAAAA,EAAAA,GACZ,GAAAC,OAAAC,GAAA,OAAA,EACDL,OAASG,EARkEF,IAd/E,WACI,IADgB,IAAAK,EACFT,EAAdU,EAAA,EAAAA,EAAAD,EAAAE,OAAAD,IAAsB,CAAjB,IAAIF,EAACC,EAAAC,GACN,IAAsB,IAAlBb,EAAGe,OAAOJ,GAAW,OAAO,EAEpC,OAAO,EAUoEK,GAA3EC,SAEH,IADGlB,IAAAA,EAH4BU,CAAyD,uBAIxFS,EAAA,EAAAA,EAAAC,EAAAL,OAAAI,IAAA,CAAA,IAAAP,EAAAQ,EAAAD,GAAAZ,SAAAc,iBAAAT,EAAA,WAAAM,MATD,SAASA,IACL,IAAIlB,EAAJ,CACA,IAAIsB,EAAOf,SAASgB,cAAc,OAClCD,EAAKE,UAzCLxB,itBA0CAO,SAASkB,KAAKC,YAAYJ,GAC1BK,WAAW,WAAQpB,SAASG,eAAe,aAAakB,UAAY,cAAiB,KACrFD,WAAW,WAAQnB,GAAQ,IAAW,KACtCD,SAASG,eAAe,iBAAiBW,iBAAiB,QAAS,WAAQb,GAAQ,KACnFR,GAAW,GAGf,SAASQ,OAAuB,EAAAqB,UAAAd,aAAAe,IAAAD,UAAA,KAAAA,UAAA,MAExBtB,SAASG,eAAe,aAAakB,UAAY,WAErDrB,SAASG,eAAe,aAAakB,UAAY,IA9FzD","file":"whynotoib.min.js","sourcesContent":["\"use strict\";\n\n(function () {\n\n // Constants\n let page = `\n\n\n
\n

你好。

\n

为什么不试试用你的浏览器(而不是微信)访问这里呢?

\n

点击右上角的三个点,然后选择“在浏览器中打开”。

\n

这能更好地保护你的隐私,也许还能更好地保护互联网。

\n

[为什么?] [立即隐藏]
\n (我们会在显示7秒后自动隐藏。)

\n
\n`\n\n let haveDone = false;\n let ua = navigator.userAgent;\n let uaList = [\n /(M|m)icro(M|m)essenger/,\n /TIM\\//,\n /QQ\\//\n ];\n let objectList = [\n \"WeixinJSBridge\"\n ]\n let eventList = [\n \"WeixinJSBridgeReady\"\n ]\n\n // Execution\n\n if (searchObject() || searchUa()) {\n showOIB();\n } else {\n for (let i of eventList) document.addEventListener(i, () => { showOIB(); })\n }\n\n // Functions\n\n function searchObject() {\n for (let i of objectList) {\n if (window[i]) return true;\n }\n return false;\n }\n\n function searchUa() {\n for (let i of uaList) {\n if (ua.search(i) !== -1) return true;\n }\n return false;\n }\n\n function showOIB() {\n if (haveDone) return;\n let elem = document.createElement(\"div\");\n elem.innerHTML = page;\n document.body.appendChild(elem);\n setTimeout(() => { document.getElementById('whynotOIB').className = \"oibDisplay\"; }, 1000);\n setTimeout(() => { hideOIB(false); }, 8000);\n document.getElementById('hideOIBRegBox').addEventListener('click', () => { hideOIB(true) });\n haveDone = true;\n }\n\n function hideOIB(sudden = true) {\n if (sudden) {\n document.getElementById('whynotOIB').className = \"noTrans\";\n }\n document.getElementById('whynotOIB').className = \"\";\n }\n})()\n"]} --------------------------------------------------------------------------------