From 5b5f3a112bef29ef897818ae4defd769a08309ce Mon Sep 17 00:00:00 2001 From: lete114 Date: Wed, 3 Mar 2021 14:03:56 +0800 Subject: [PATCH] Version1.1 --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 7 +- SplitScreen-128.png | Bin 0 -> 2073 bytes SplitScreen-16.png | Bin 0 -> 1298 bytes SplitScreen-32.png | Bin 0 -> 1488 bytes SplitScreen-64.png | Bin 0 -> 1659 bytes SplitScreen.css | 76 +++++++++++++++++ SplitScreen.js | 94 ++++++++++++++++++++- icon.png | Bin 9984 -> 0 bytes manifest.json | 16 ++-- popup.html | 16 ++++ 11 files changed, 396 insertions(+), 14 deletions(-) create mode 100644 LICENSE create mode 100644 SplitScreen-128.png create mode 100644 SplitScreen-16.png create mode 100644 SplitScreen-32.png create mode 100644 SplitScreen-64.png create mode 100644 SplitScreen.css delete mode 100644 icon.png create mode 100644 popup.html diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 9bdc54e..4bee9b8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# SplitScreen +# 网站分屏(SplitScreen) -> Website split screen is Chrome Plugins +> 谷歌浏览器网站分屏插件 (Website split screen is Chrome Plugins) +## 插件功能(Expandable function) +![SplitScreen Window](https://cdn.jsdelivr.net/gh/lete114/CDN/SplitScreen/SplitScreen-window.png) +## 插件执行效果(Plug-in execution effect) ![SplitScreen Demo](https://cdn.jsdelivr.net/gh/lete114/CDN/SplitScreen/Demo1.png) \ No newline at end of file diff --git a/SplitScreen-128.png b/SplitScreen-128.png new file mode 100644 index 0000000000000000000000000000000000000000..3522cf74e4970cef6257d0d5fb5af86397f94d74 GIT binary patch literal 2073 zcmd5-ZB!KH9-ovF$u*9WNm`D}sjJp7`_9h5@;b|lxr*z`Qi8ZI!?ME8tg{0wAY!SM zB@!mpy@y1uQh6mhdv(u-2#5$2F0KnD1u6E5@wOPox)Iteg53`uKip5vIWy1mf1dyE z_kTaLKXH8=%kODF003AC@tB-hcQdci_c7*srN-RFEP=E%nchUE)43`N2cop38V3^$ zDjhDzRoc8AU*KT?FgHi9NT!oz>rf482v&J@g3Sgag9d=G2(wY8$;4?;jqCJ;gzc(t zVuO0Egsl|HI5J}lo}rJ=r|?br>lK>(Obw!CM}&i6W|Sc?;Is-f8?p!!YL>94c~NHX zJ%-ufvrD-ePqNHAB#7a+)sAdkZp!yGZp!p@*+BMQU0xw*l){9uyO!CVAEU=9!F@gPP6GUXAp$_x>v zpjieCH)$xnk=Bz0=w(!?$!uD}W<0$Yg25=0-6tkYGl^nS2Afqzm>bN24F+#q)7mCl zj{oJx1GPhCVi6<~rmGji= zuU!TJA0z>bQkZ*(zmdf+R|4m5y07gV9~Q@VO(VpvVo<<_;^TUq~2?YU|%$a_bf@Jnkd z$3A?gh{GOTcb7JQlP!Py}7HaOE)w$R9R73nPyrZhdq91L*_I4z+p=* zYr%q=OAPN5ESAI*vYSDFd+XLMcW7v+%~V(M_QdHp6B-)2xY6Z;VYojqFwm1KElNpA z`6H~-(LZ|Q#`WtVbu{`+Dy!Dva1^Dk3g}&4kY*-v{3pWSC$RVtRsA^;UeCI>wH~b`zzk8%8*T5a0j$p{@ymHcsCFU zWNc4u3tV;$uvfrLATl9RXGr*SeNeA^wj%Nch z(i~Fz!gj+ywE^4Q7d`bg3TslX4-urhV_nzwZA11;w!9+?WM`XJ+4GNl=DtyOhbZXV zzpF`c-8%4Zx*={LV(RmFLujcde0x7X#8tSg@us=Yx%%$lr@%%{U{85YW&Z6+lnqk0N+iv5ud)x+L_s(2soSeFZ`o*ki6-}rjo(UxLc*~>t8 zq(9&b_yBW&N4%kdz~4X|D~wNtt^BU^VVOA5)cfwW)Slb5m8{=!I*-nJjpGynaculwoVKKMfz*HYQ}!`crIzOv$k z)9GAsSpHn`F{|R_W@k^2JF=v-G~$NKl?J_c@xa=l3eWlRvmY&9yx3hnbVi+%Gw~Ma zJF%wR?^ySb=Q#n@@)N&Xgkte$|A0sDZrQRW5`rKH9mXEpA@; znPHpF=5pBWc9~2zwY1^+v_c?EBFRotDqUGwSv$=X^=pnLd3ed)ohkNBYWa%slCrv# uQN2z#P}cC(-7p04$Vk%VY#oAqmICMBP_Mj_aWc>Qvrdq%$7-Xuz4j+IDJ~`e literal 0 HcmV?d00001 diff --git a/SplitScreen-16.png b/SplitScreen-16.png new file mode 100644 index 0000000000000000000000000000000000000000..b3b323a304f4df639cf3af26d544169e144d42c1 GIT binary patch literal 1298 zcmbVMZD<>19KVpYjcc|JqRUG6n6cQ$=VE-}%ii&^@H4stI~nxoC#d3SBD zVNUC0){3$z8*|$SVPA&e)DME-umK}%#WB$jqDaQD3Z ze*gdP`M=!T*`epQZGC(zf*{+{DIo{P9q`@mX@}q4#MuQn`0d1)eLyeT710F9prT6v zO_#+9kOQJJ`^sg|iy-b9H9uyLW%lv1UJi&2Ou#7{kc}X{{f;5ZlfXtLFrjKu?ABL{ z7^*5!Y&4i5Ge#Vg)Kt|32dYDPxjHFx3fA9;_BuQ?PzJV$I^`+N;+-hAW|xQa#x{YW zYY=-fimi(p%Vg2GZUQtI2;nlt2GKAVph67GaeGmkq#^_vAt(l?LOe_IG>tYN40=#(gaQ85P@5>nk_oGX7#iz2*8p})v#4v zLmL)FNuRc(7*x7`g|d;!Y#7$8W}slm2uCysDnJtDa^qfWXv@xle`Rcnw(_$EAacOc zr%f5=quA3T!`MCCQ3D9o@cT^_CPkbQba}cAG&?OsF?bSCRE4K#2BtU?!b8ELgi{nt zeE*G#+ncokO1e zPiqTSWMjI~3UIN}OhAJjWWrV{cFNBqh>K1OgL&r{$?NrAtloO?>L>kP?`!_=k!L$Q z-M3d)z55mqpL>D2SCpiaFCJUGT$+;pdgrYZCx(Yp^EY;8DGwQY?APkb$s0aj&o`B} z@sH5#qt9He)$6t8zy0o&pY+A?2T0rSmNx(0g9rVG@2_->)IE7G{nW&d#iPD!e|RgM zKh#cNZ~yFb`uv?M%Jr|Ecjwyb9Y5dmonH>0b`@@-zg^v#cNZ?Wa(j*ab6X1CyDklQ zP%rY~(xv&rxi{OjT76(wx8rW_+c7>cL%MCdfUL z3-id$)gw<_@l1dF#ptKqeKbQI8Xl>omR|09k}(b~-#wEUN&f!l{f;hnd$f9|>!qUP q-W_}I_9)5t80Ld7FJ6nkj<}JJhph3V@+0BKUn-p#5-!9FZ~Ox>4zDl( literal 0 HcmV?d00001 diff --git a/SplitScreen-32.png b/SplitScreen-32.png new file mode 100644 index 0000000000000000000000000000000000000000..fa80a58aa21170cb99ec6a5566957d26ed703560 GIT binary patch literal 1488 zcmbVMZBP_-9A2eSbRY?_fUaDZnF?}mZ}(nz<1p?GPCPvhX27&?Z+C$e?)Kc>^Gf}BHiJU-Fkf9N6N)SfKKBP7d?EzaY&nNdOY~oodDP*aMqr5K0Em}=_NctkDS(-pGrIccw2G*zx zoiK{3FxW}cDp-T*a3`grahyTJJPX+yEt+(N!HjDSCIgC^4F;{+f@{86;lZ&va>Z>xK#En(ytQsnqtjw=mUfxVa$IiZ;IfJS2|>p1va9_yw#pO73% z)7-6149}J^w1wwf;B1@;b^#5lkVvJIft5PU2^TUd6xK;40Bf`~Md~P}n#Og|ygmJY z*|T%_dfH)ntCV>&Y3c-Vs?f`opKTf!5FB(94M(B8a_zVpSb4OD3x;8dJ{c zUdbA=w+wqy^lTL*7}z5`iJ*k-533)r|s;Wz_M>oJrR=- z7(SMrI#YXa|55vhibZbiHy1Rl_is5gI{1z|zGGC^+1X{8x*dDqLSuc|v@jFB%IZH; zw=!;5<6o=4yniAh1_&;$U}LMc{gK_{-5&eFh0a?mi}u$&dj*hLZwC*4x4TvbE z_C>RIyH+2A>&9F$ksn{Ls@*!nk-sN3%YF+?tT@1r+0K+W)lKJj939+gixFF}HO=Gq p9d(o1v>R;y#kGeACxX7kQGgj7OJ1=!K}9yBv=3d literal 0 HcmV?d00001 diff --git a/SplitScreen-64.png b/SplitScreen-64.png new file mode 100644 index 0000000000000000000000000000000000000000..a108956b4f01484c463e32d92e74a1c4302b9a15 GIT binary patch literal 1659 zcmbVLc~BEq7+*9BMjcUV2kX&g#e+h!+07k^kOM-hQ5vG8%2YSI8(1Z~akH2RR-G~( zR6HnHUg16iWa9=HC>JY4I3kmSO0^hKNM&ku9EeH~6)aJ~h*X3qG%|?>MZtju@zz+v zsj(W92W;_@7Rur{w+4p2Ua#0I6*FumjHuOWSc1YRD&jRno)t8Q`9!p5a*)ADdT^F< za}+~^0Y=QhwF1N+)uQwD>wuuA_S44A_qapL<&@;cHlBXttOEm&#Uly9b%A6)Jmn^s7H__y-uM_)+wckUT0J$ zp$dHvYoz$#vg)fiY3;~3V)FxkN_NX=q6#*@XkL4zSsbu~CWouUcG z>xl`J=|$8=lBJfDL^8{`!2UdIs8{$PlS(9Vse=?rRj5PcBxQ(5#kYV+p(Jojg-hjx zS_KW@iT|5Fn0E>eG|Ru5CwRqoWZ?L66nNp~Fp)GrK`cKi8{D%y0ANss*{HMmF5Rm* zTo|EyqxqLJ_gZLZ+GspV(Dd$m`@)A0|9)8d`;%fy(9U-IH%)_eDJ92`Bs88sb!XFr zjAcbrE2oA(V1?z{(X}_7wbGVbrVjE#*wL~6KNo{VH}3z?`m{lLW_*#gm_CqK@6Z12 z@zcIMEb<@#o)}uberzO;eV+QnUNwKmn}t7qc$d?7yB_tv+RR=q9ZQv zZ{C=U7i?_qQ06yXZ|FK$d%eA8i%=%G+VzNTJDbIs&VrQm^xn1IPcQ7*6%t*U95W=A zI%+HJ{#ZKf_#fliuBBQ0zK3bWo9F4z>EO)TbGzgBeV00<$AhX16NgM9rAD{dVp#kP zUQO>7om--LchGF z7@Swzv%tCe@S2*cN5F}s{rgp+B>*Z+oG;I)>n%R-58ay+0u`1CcG9bRpHHc=9bwBP z_f5x6F5EtLcU#4s(>n)^86Rb?ivk2|fN)??A`k|IfPmmX3yRBQzB)F&G23j2xOFLg z@3hjn%gf5`i;m8PfWEDXaa)JAuX=WanmJ_&Yqg!aeX*k#h^!>y%Nk1#X-@(hCYoX! zM;VTE`cFk{GE_HQD~K&Hm2WYBnlJr5@z{t(3lM$uC&K#Gxl2|SXBcYc18wB-L*3U` zKHPAjuIAf|Y)V{6%f&iHwDxCFYfpu2{jQ&`0{Sq$r|wFDOy7ohS`yk9R6Wklc6YH`v!`KmY&$ literal 0 HcmV?d00001 diff --git a/SplitScreen.css b/SplitScreen.css new file mode 100644 index 0000000..c74bd53 --- /dev/null +++ b/SplitScreen.css @@ -0,0 +1,76 @@ +html{ + display: inline-table; +} +body{ + width: 300px; +} +#SplitScreen{ + width: 148px; + line-height: 1; + border: 1px solid #dcdfe6; + -webkit-appearance: none; + text-align: center; + font-weight: 600; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + padding: 12px 20px; + font-size: 14px; + border-radius: 4px; + color: #fff; + background-color: #67c23a; + border-color: #67c23a; +} +#SplitScreen:hover{ + background: #85ce61; + border-color: #85ce61; +} +#clean{ + width: 148px; + line-height: 1; + border: 1px solid #dcdfe6; + -webkit-appearance: none; + text-align: center; + font-weight: 600; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + padding: 12px 20px; + font-size: 14px; + border-radius: 4px; + color: #fff; + background-color: #f56c6c; + border-color: #f56c6c; +} +#clean:hover{ + background: #f78989; + border-color: #f78989; +} +input[placeholder]{ + width: 300px; + -webkit-appearance: none; + background-color: #fff; + background-image: none; + border-radius: 4px; + border: 1px solid #dcdfe6; + box-sizing: border-box; + color: #606266; + display: inline-block; + font-size: inherit; + height: 40px; + line-height: 40px; + outline: none; + padding: 0 15px; +} +input{ + margin-bottom: 6px; +} +#alert{ + font-weight: 600; + text-align: center; + padding: 8px 16px; + border-radius: 4px; + background-color: #f56c6c; + color: #fff; + font-size: 13px; +} \ No newline at end of file diff --git a/SplitScreen.js b/SplitScreen.js index 74e3c01..0bf8baf 100644 --- a/SplitScreen.js +++ b/SplitScreen.js @@ -1,5 +1,93 @@ -chrome.browserAction.onClicked.addListener(function(tab) { +// 监听键盘弹起事件 +document.onkeyup=function(e){ + // 获取输入的值 + var left = document.getElementById('left').value; + var right = document.getElementById('right').value; + + /* + * left.indexOf("http") + * right.indexOf("http") + * 判断是否以HTTP协议开头的链接 + */ + if(left!=""){ + if(left.indexOf("http")!=0){ + document.getElementById('alert').style.display="block"; + return + }else{ + document.getElementById('alert').style.display="none"; + } + } + if(right!=""){ + if(right.indexOf("http")!=0){ + document.getElementById('alert').style.display="block"; + return + }else{ + document.getElementById('alert').style.display="none"; + } + } + document.getElementById('alert').style.display="none"; +} + +document.getElementById('SplitScreen').addEventListener('click', function(e) { + // 获取输入的值 + var left = document.getElementById('left').value; + var right = document.getElementById('right').value; + /* + * left.indexOf("http") + * right.indexOf("http") + * 判断是否以HTTP协议开头的链接 + */ + if(left!=""){ + if(left.indexOf("http")!=0){ + document.getElementById('alert').style.display="block"; + return + }else{ + document.getElementById('alert').style.display="none"; + } + } + if(right!=""){ + if(right.indexOf("http")!=0){ + document.getElementById('alert').style.display="block"; + return + }else{ + document.getElementById('alert').style.display="none"; + } + } + document.getElementById('alert').style.display="none"; + // 定义变量 + var data = ""; + // 当前打开的网址 + if(left==""&&right==""){ + data = `document.write(''+document.title+'')}` + data = `if(document.getElementById("left")!=null){document.getElementById("left").src=location.href;document.getElementById("right").src=location.href}else{`+data + } + // 自定义-左侧分屏网址 / 右侧分屏网址 + if(left!=""&&right!=""){ + data = `document.write(''+document.title+'')}` + data = `if(document.getElementById("left")!=null){document.getElementById("left").src=left;document.getElementById("right").src=right}else{`+data + data = "var left = "+`'${left}';`+data + data = "var right = "+`'${right}';`+data + }else + // 自定义-左侧网址 / 当前网址地址 + if(!left==""){ + data = `document.write(''+document.title+'')}` + data = `if(document.getElementById("left")!=null){document.getElementById("left").src=left;document.getElementById("right").src=location.href}else{`+data + data = "var left = "+`'${left}';`+data + }else + // 自定义-当前网址地址 / 右侧网址 + if(!right==""){ + data = `document.write(''+document.title+'')}` + data = `if(document.getElementById("left")!=null){document.getElementById("left").src=location.href;document.getElementById("right").src=right}else{`+data + data = "var right = "+`'${right}';`+data + } + // 执行页面程序 chrome.tabs.executeScript({ - code: `document.write(''+document.title+'')` + code: data }); -}); \ No newline at end of file +}); +// 清空 +document.getElementById('clean').addEventListener('click', function(e) { + document.getElementById('left').value=""; + document.getElementById('right').value=""; + document.getElementById('alert').style.display="none"; +}) diff --git a/icon.png b/icon.png deleted file mode 100644 index c081beaf73294926875d1a84864e427c43291112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9984 zcmZ`f}Ny_BmhtskN#wV z_|~SflGjuL0Q^A!05lW;cz82G_W=MO4glcL8~_kX0|1EJvsyJo-a3#hmE@!Wum6?2 zj?$zz3#z-kffoRP)&HNuC9`0?e={O`E2zjI@4&&Kl4HVRWgOqeK2wmE)V5!9@w?SC z^7}{sI(VwA_Cfe7cjGXM^tVtPDruyhEU$4~Ivl~hH|!DEYg`qz+l_dZYFxwjZo6&U zoAC?s$8&d^?a;YS?2{&qn43Gi`Osn%lG8YTQ|($Y;^hAGLAdS2HFstm=jfOwd2-`2 z;Iql;4OaS`_G~|+Tb?eTCd+&K;@Po9nb5TD(s)ZtieLTR*B-2R?w3@Y4`!kJ0SA-u zg%f*2Ms*u?9vdDPxEH7zsHhIatlv`3 zJ4N^QHOMmUoMN043{woLr(ZuKIrq64y0-PiuWyIRx)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+bpdnwJrtOn15uIf23oto?KXJjgujUgS4~+ z7%dY-cffbyfcj@jRzaJmIvm}351MGV&W zDdKbWXrnd) zs;{rO&0xf#13i0ns{AhA0u=koS0drbYXSlEGrPCnVD#QH`rg(S-Zny3o;Gg);Nsxo z1atf++8lyHT!KQJ+$4Ke@x EKVKi?uK)l5 diff --git a/manifest.json b/manifest.json index 3f0c290..5dc515d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,18 +1,16 @@ { "name": "SplitScreen", - "version": "1.0", - "description": "Website split screen is Chrome Plugins ", - "browser_action": {"default_icon": "icon.png"}, + "version": "1.1", + "description": "谷歌浏览器网站分屏插件 Website split screen is Chrome Plugins ", + "browser_action": {"default_icon": "SplitScreen-128.png","default_popup": "popup.html","default_title": "SplitScreen"}, "permissions": ["http://*/*","https://*/*"], "manifest_version": 2, "author": "Lete乐特", "homepage_url": "https://github.com/lete114/SplitScreen", - "background": { - "scripts": ["./SplitScreen.js"], - "persistent": false - }, "icons": { - "128": "icon.png", - "16": "icon.png" + "128": "SplitScreen-128.png", + "64": "SplitScreen-64.png", + "32": "SplitScreen-32.png", + "16": "SplitScreen-16.png" } } \ No newline at end of file diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..fb695e0 --- /dev/null +++ b/popup.html @@ -0,0 +1,16 @@ + + + + + SplitScreen + + + + + + + + + + + \ No newline at end of file