From 535bc44674ea8c9fae6c08745deac01b1885c2f2 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Thu, 25 Feb 2016 23:30:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=AB=98=E4=BA=AE=E7=89=87=E6=AE=B5=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E4=B8=8D=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/bg.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/bg.js b/js/bg.js index 64e0ea6..a3f877f 100644 --- a/js/bg.js +++ b/js/bg.js @@ -9,12 +9,15 @@ chrome.extension.onRequest.addListener( for (var i = 0; i < elms.length; i++) { var styl = elms[i].getAttribute('style'); if(elms[i].tagName === 'PRE'){ - elms[i].setAttribute('style',' word-wrap: normal!important;box-sizing: border-box; overflow: auto;font-size: 0.93em; padding: 1em; margin-top: 1.5em; margin-bottom: 1.5em; line-height: 1.3; word-break: break-all; word-wrap: break-word; color: rgb(101, 123, 131); border: none; border-radius: 3px; max-height: 35em; background-color:#E1E1E9;') + elms[i].setAttribute('style','box-sizing: border-box; overflow: auto;font-size: 0.93em; padding: 1em; margin-top: 1.5em; margin-bottom: 1.5em; line-height: 1.3; word-break: break-all; word-wrap: break-word; color: rgb(51, 51, 51); border: none; border-radius: 3px; max-height: 35em; position: relative;background-color:#EBEBF0;word-wrap: initial!important;') }else if(elms[i].tagName === 'CODE'){ - elms[i].setAttribute('style','box-sizing: border-box;font-size: 1em; color: inherit; border-radius: 0px; white-space: inherit; overflow-wrap: normal; background: none;') + elms[i].setAttribute('style','box-sizing: border-box;font-size: 1em; color: inherit; border-radius: 0px; white-space: inherit; overflow-wrap: normal; background: none;word-wrap:normal!important;') }else{ if(styl){ styl = styl.replace(/font-family\:[\s\S]*?\;/g,''); + if(elms[i].tagName === 'SPAN'){ + styl += 'word-wrap:normal!important;'; + } elms[i].setAttribute('style',styl); } }