@@ -715,11 +715,11 @@ cloudopt.config = (function (cloudopt) {
715715 }
716716
717717 /**
718- * Add whiteList for config
718+ * Add whiteList-ads for config
719719 *
720720 * @param callback callback when succeed
721721 */
722- function autoAddWhiteList ( callback ) {
722+ function autoAddWhiteListAds ( callback ) {
723723 var fileName = "/whitelist/" ;
724724 switch ( cloudopt . getLanguage ( ) ) {
725725 case "zh-CN" :
@@ -730,15 +730,13 @@ cloudopt.config = (function (cloudopt) {
730730 $ . getJSON ( fileName , function ( data ) {
731731 var config = cloudopt . config . get ( ) ;
732732 $ . each ( data , function ( index , obj ) {
733- config . whiteList [ config . whiteList . length ] = obj . host ;
733+ config . whiteListAds [ config . whiteListAds . length ] = obj . host ;
734734 } ) ;
735735 cloudopt . config . set ( config , function ( ) {
736736 cloudopt . message . send ( "refresh-config" ) ;
737737 callback ( ) ;
738738 } ) ;
739739 } ) ;
740-
741-
742740 }
743741
744742 /**
@@ -802,7 +800,7 @@ cloudopt.config = (function (cloudopt) {
802800 set : set ,
803801 refresh : refresh ,
804802 activateEquipment : activateEquipment ,
805- autoAddWhiteList : autoAddWhiteList ,
803+ autoAddWhiteListAds : autoAddWhiteListAds ,
806804 fastAddWhiteList : fastAddWhiteList ,
807805 fastAddWhiteListAds : fastAddWhiteListAds ,
808806 fastAddBlackList : fastAddBlackList ,
@@ -980,6 +978,9 @@ cloudopt.grade = (function (cloudopt) {
980978 if ( config . whiteList . indexOf ( item . host ) > - 1 && item . safe < 0 ) {
981979 item . safe = 0 ;
982980 }
981+ if ( config . whiteListAds . indexOf ( item . host ) > - 1 && item . safe < 0 ) {
982+ item . safe = 0 ;
983+ }
983984 /*if in black list*/
984985 if ( config . blackList . some ( e => e === item . host ) ) {
985986 item . safe = - 1 ;
@@ -1010,6 +1011,9 @@ cloudopt.grade = (function (cloudopt) {
10101011 if ( config . whiteList . indexOf ( result . host ) > - 1 && result . safe == - 1 ) {
10111012 result . safe = 0 ;
10121013 }
1014+ if ( config . whiteListAds . indexOf ( result . host ) > - 1 && result . safe == - 1 ) {
1015+ result . safe = 0 ;
1016+ }
10131017 if ( data . result . host != "" ) {
10141018 result . date = new Date ( ) . getTime ( ) ;
10151019 cloudopt . store . set ( website , result ) ;
@@ -1062,7 +1066,7 @@ cloudopt.init = (function (cloudopt) {
10621066 url = tabArray [ tabArray . length - 1 ] . url ;
10631067 host = cloudopt . utils . getHost ( url ) ;
10641068 // cloudopt.browserIconChange.normal();
1065- if ( tabArray [ tabArray . length - 1 ] . url . indexOf ( "file://" ) == 0 || tabArray [ tabArray . length - 1 ] . url . indexOf ( "chrome-extension://" ) == 0 || tabArray [ tabArray . length - 1 ] . url . indexOf ( "chrome://" ) == 0 || cloudopt . config . get ( ) . whiteList . indexOf ( host ) > - 1 ) {
1069+ if ( tabArray [ tabArray . length - 1 ] . url . indexOf ( "file://" ) == 0 || tabArray [ tabArray . length - 1 ] . url . indexOf ( "chrome-extension://" ) == 0 || tabArray [ tabArray . length - 1 ] . url . indexOf ( "chrome://" ) == 0 || cloudopt . config . get ( ) . whiteList . indexOf ( host ) > - 1 || cloudopt . config . get ( ) . whiteListAds . indexOf ( host ) > - 1 ) {
10661070 cloudopt . browserIconChange . gray ( ) ;
10671071 return ;
10681072 }
0 commit comments