├── .atom-build.yml ├── LICENSE ├── README.md ├── artwork ├── buttons.png ├── buttons.psd └── link.png ├── extension ├── README ├── _locales │ ├── en │ │ └── messages.json │ └── ja │ │ └── messages.json ├── background_page.html ├── css │ ├── block │ │ ├── button-container.css │ │ ├── customblocker-keyword.css │ │ ├── header.css │ │ ├── keyword.css │ │ ├── rule-list.css │ │ └── var.css │ ├── context │ │ ├── keywords.css │ │ ├── reset.css │ │ ├── rule_editor_cursor.css │ │ └── smart_rule_editor.css │ ├── help.css │ ├── help_small.css │ ├── index.css │ ├── keywords.css │ ├── pref │ │ ├── help.css │ │ └── list_rules.css │ ├── reset.css │ ├── rule_editor.css │ ├── rule_editor_common.css │ ├── rule_editor_cursor.css │ ├── smart_rule_editor.css │ └── welcome_install.css ├── en │ └── rule_editor_frame.html ├── help │ ├── en │ │ ├── block_anyway.html │ │ ├── hide.html │ │ ├── keywords.html │ │ ├── search.html │ │ ├── site.html │ │ └── smart.html │ └── ja │ │ ├── block_anyway.html │ │ ├── hide.html │ │ ├── keywords.html │ │ ├── search.html │ │ ├── site.html │ │ └── smart.html ├── icon │ ├── icon.png │ ├── icon128.png │ ├── icon32.png │ ├── icon48.png │ └── icon_disabled.png ├── img │ ├── button │ │ ├── add.png │ │ ├── delete.png │ │ ├── edit.png │ │ ├── link.png │ │ ├── off.png │ │ └── on.png │ ├── help │ │ ├── blocked.png │ │ ├── help1-en.png │ │ ├── help1-ja.png │ │ ├── help2-en.png │ │ ├── help2-ja.png │ │ ├── help3.png │ │ ├── help4.png │ │ ├── new_ui.png │ │ ├── old_ui.png │ │ ├── rightclick-detail-en.png │ │ ├── rightclick-detail-ja.png │ │ ├── rightclick-en.png │ │ ├── rightclick-ja.png │ │ ├── rightclick-list-en.png │ │ └── rightclick-list-ja.png │ ├── help_icon.png │ ├── icon_regexp.png │ ├── icon_upper.png │ ├── import_add.png │ ├── import_update.png │ ├── keyword_case_sensitive.png │ ├── keyword_case_sensitive_blue.png │ ├── keyword_case_sensitive_red.png │ ├── keyword_delete.png │ ├── keyword_include_href.png │ ├── keyword_include_href_blue.png │ ├── keyword_include_href_red.png │ ├── keyword_regexp.png │ ├── keyword_regexp_blue.png │ ├── keyword_regexp_red.png │ ├── loading.gif │ ├── open_minus.png │ ├── open_plus.png │ ├── rule_editor_close.png │ ├── search_icon.png │ ├── smart_path_preview_img.png │ ├── title_small.png │ ├── top_title.png │ ├── wand_transparent.png │ ├── word_delete.png │ ├── word_delete_hover.png │ ├── world.png │ └── xpath_picker.png ├── index.html ├── ja │ └── rule_editor_frame.html ├── manifest.json ├── pref │ ├── help_en.html │ ├── help_ja.html │ ├── includes │ │ ├── rule_editor.html │ │ └── rule_editor_body.html │ ├── index.html │ ├── welcome_en.html │ ├── welcome_ja.html │ └── word_group.html ├── rule_editor_frame.html ├── smart_rule_editor_en.html ├── smart_rule_editor_ja.html ├── smart_rule_list_sample.html ├── src │ ├── analytics.js │ ├── background.js │ ├── contentscript.js │ ├── css_builder.js │ ├── db │ │ ├── DbInit.js │ │ ├── DbObj.js │ │ ├── Rule.js │ │ └── Word.js │ ├── element_highlighter.js │ ├── index.js │ ├── path_analyzer.js │ ├── pref │ │ ├── export.js │ │ ├── help.js │ │ ├── import.js │ │ ├── import_export.js │ │ └── list_rules.js │ ├── rule_editor.js │ ├── rule_editor │ │ └── rule_editor_frame.js │ ├── rule_executor.js │ ├── smart_path_analyzer.js │ ├── smart_rule_editor.js │ ├── util.js │ ├── uuid.js │ ├── welcome │ │ ├── preset_en.js │ │ ├── preset_ja.js │ │ └── welcome.js │ └── xpath_builder.js ├── welcome_en.html ├── welcome_install_en.html ├── welcome_install_ja.html └── welcome_ja.html ├── gulpfile.js ├── pug-i18n └── rule_editor_frame.pug ├── pug-locale ├── en.json └── ja.json ├── pug └── pref │ ├── help_en.pug │ ├── help_ja.pug │ ├── includes │ └── rule_editor_body.pug │ ├── index.pug │ ├── layout.pug │ └── word_group.pug ├── scss ├── block │ ├── button-container.scss │ ├── customblocker-keyword.scss │ ├── header.scss │ ├── keyword.scss │ ├── rule-list.scss │ └── var.scss ├── context │ ├── keywords.scss │ ├── reset.scss │ ├── rule_editor_cursor.scss │ └── smart_rule_editor.scss ├── help.scss ├── help_small.scss ├── index.scss ├── keywords.scss ├── pref │ ├── help.scss │ └── list_rules.scss ├── rule_editor.scss ├── rule_editor_common.scss └── welcome_install.scss ├── ts ├── README ├── src │ ├── CustomBlocker.ts │ ├── background.ts │ ├── background_legacy.ts │ ├── contentscript.ts │ ├── css_builder.ts │ ├── db │ │ ├── DbInit.ts │ │ ├── DbObj.ts │ │ ├── Rule.ts │ │ └── Word.ts │ ├── element_highlighter.ts │ ├── index.ts │ ├── path_analyzer.ts │ ├── pref │ │ ├── help.ts │ │ ├── list_rules.ts │ │ ├── word_editor.ts │ │ └── word_group.ts │ ├── rule │ │ ├── Rule.ts │ │ ├── Storage.ts │ │ ├── Word.ts │ │ └── WordGroup.ts │ ├── rule_editor.ts │ ├── rule_editor │ │ └── rule_editor_frame.ts │ ├── rule_executor.ts │ ├── smart_path_analyzer.ts │ ├── smart_rule_editor.ts │ ├── util.ts │ ├── uuid.js │ ├── welcome │ │ ├── preset_en.ts │ │ ├── preset_ja.ts │ │ └── welcome.ts │ ├── word_group_picker.ts │ └── xpath_builder.ts └── tsconfig.json └── whats_new.txt /.atom-build.yml: -------------------------------------------------------------------------------- 1 | cmd: gulp; cd ts; tsc; cd ..; 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Maripo GODA 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Manifest v3の仕様に対応しないと最新のChromeで動かないのですが、予想以上に面倒であることが判明しました。Chromeのアップデートに対応するためにまとまった時間を作るのが難しく、今後メンテナンスを続ける時間が無いため、開発を一旦中止します。ストアでも現在非公開となっています。 2 | 3 | Complying with the Manifest v3 specification proved to be more cumbersome than expected. It is difficult to make a chunk of time to keep up with Chrome updates, and I don't have enough time to continue maintenance in the future, so I am suspending development. Also, it is removed from the store. 4 | 5 | # CustomBlocker for Google Chrome 6 | 7 | This extension filters any element on any web site with any conditionwith XPath and RegExp. 8 | 9 | [Install](https://chrome.google.com/webstore/detail/elnfhbjabfcepfnaeoehffgmifcfjlha?hl=EN) 10 | -------------------------------------------------------------------------------- /artwork/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/artwork/buttons.png -------------------------------------------------------------------------------- /artwork/buttons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/artwork/buttons.psd -------------------------------------------------------------------------------- /artwork/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/artwork/link.png -------------------------------------------------------------------------------- /extension/README: -------------------------------------------------------------------------------- 1 | Chrome extension root folder -------------------------------------------------------------------------------- /extension/_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extLocale": { 3 | "message": "en" 4 | }, 5 | "extDescription": { 6 | "message": "Filter any element on any web site with any condition with XPath and RegExp" 7 | }, 8 | "newRuleForThisSite": {"message":"New Rule for this Site"}, 9 | "preference": {"message":"Preferences"}, 10 | "activeRules": {"message":"Rules for this Site"}, 11 | "help":{"message":"Help"}, 12 | "word_group":{"message":"Word Groups"}, 13 | "newGroup" : {"message": "New word group"}, 14 | "helpKeywordGroupHeadline" : {"message": "\"Keyword groups\" feature is supported in version 4.x!"}, 15 | "helpKeywordGroupDetail" : {"message": "You can create keyword groups and add them to rules in CustomBlocker 4.x!"}, 16 | "sectionRuleTitle":{"message":"Name"}, 17 | "url":{"message":"URL"}, 18 | "sectionSite":{"message":"Site"}, 19 | "sectionSearch":{"message":"Search Region"}, 20 | "sectionHide":{"message":"Elements to Hide"}, 21 | "sectionWord":{"message":"Words"}, 22 | 23 | "selectOuterElement":{"message": "Select parent element"}, 24 | "regex":{"message":"RegEx"}, 25 | "complete_matching":{"message":"Complete Match"}, 26 | "case_sensitive":{"message":"Case Sensitive"}, 27 | "include_href":{"message":"Include Link URL"}, 28 | 29 | "exampleUrl":{"message":"Example URL"}, 30 | "description":{"message":"Description"}, 31 | "descriptionHide":{"message":"Matched elements will disappear if they meet the condition."}, 32 | "descriptionSearch":{"message":"The filter works when these elements contain \"Words\"."}, 33 | "descriptionSite":{"message":"This rule is applied on matched sites."}, 34 | "prefTitle":{"message":"Manage Rules"}, 35 | "buttonLabelEdit":{"message":"Edit"}, 36 | "buttonLabelDelete":{"message":"Delete"}, 37 | "dialogDelete":{"message":"Are you sure you want to delete this rule?"}, 38 | "tooltipCount":{"message":"__count__ Elements are Hidden."}, 39 | "tooltipCountSingle":{"message":"1 Element is Hidden."}, 40 | "errorTitleEmpty":{"message":"Title cannot be empty"}, 41 | "errorSiteRegexEmpty":{"message":"Site RegEx cannot be empty"}, 42 | "errorHideXpathInvalid":{"message":"XPath for \"Elements to Hide\" is invalid"}, 43 | "errorSearchXpathInvalid":{"message":"XPath for \"Search Region\" is invalid"}, 44 | "saveDone":{"message":"The rule is successfully saved."}, 45 | "wordGroupSaveDone":{"message":"The group is successfully saved."}, 46 | "wordGroupDelete":{"message":"Are you sure you want to delete the group \"___GROUP___\"?"}, 47 | "manageGroups":{"message":"Manage word groups"}, 48 | "errorWordGroupNameEmpty":{"message":"Title cannot be empty."}, 49 | "descriptionEmpty":{"message":"There is no rule. Make rules for your favorite sites or import preset rules"}, 50 | "helpEmpty":{"message":"[Learn how to make rules]"}, 51 | "ruleEditorExistingRules":{"message":"Existing Rules"}, 52 | "ruleEditorNewRules":{"message":"New Rules"}, 53 | "smartRuleEditorShowAdvancedMode":{"message":"Show details"}, 54 | "smartRuleEditorHideAdvancedMode":{"message":"Hide details"}, 55 | "smartRuleEditorSuggestedTitlePrefix":{"message":"Pattern "}, 56 | "menuCreateRule":{"message":"Create a Rule"}, 57 | "menuAddToExistingRule":{"message":"Add to an existing rule"}, 58 | "smartRuleEditorSuggestedButtonLabel":{"message":"Create"}, 59 | "smartRuleEditorExistingButtonLabel":{"message":"Edit"}, 60 | "smartRuleEditorSuggestedMessage":{"message":"This rule is automatically suggested."}, 61 | "ruleSuffix":{"message":"Rules"}, 62 | "unsavedDialog":{"message":"There are unsaved changes in this rule. Are you sure you want to close this dialog?"}, 63 | "selectAll":{"message":"Select All"}, 64 | "blockAnyway":{"message":"Block anyway"}, 65 | "filterWithKeywords":{"message":"Filter with keywords"}, 66 | "condition":{"message":"Condition"}, 67 | "invalidRegEx":{"message":"Invalid regular expression."}, 68 | "errorExportNoRule":{"message":"No rule is selected."}, 69 | "welcomeDone":{"message":"Filters are installed! Enjoy CustomBlocker by adding some keywords!"}, 70 | "alreadyInstalled":{"message":"INSTALLED"}, 71 | "showBadge":{"message":"Show number of blocked elements on app icon"}, 72 | "installPreset":{"message":"Install preset rules"}, 73 | "donate":{"message":"Donate"}, 74 | 75 | "migrationFlagNotFound": {"message":"It seems that something went wrong when CustomBlocker tried to upgrade rules you created on version 2.x."}, 76 | "migrationLink": {"message":"Click to retry data upgrade manually"} 77 | } 78 | -------------------------------------------------------------------------------- /extension/_locales/ja/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extLocale": { 3 | "message": "ja" 4 | }, 5 | "extDescription": { 6 | "message": "サイト・要素・キーワードなどを指定してフィルタを自由に作れる" 7 | }, 8 | "newRuleForThisSite": {"message":"このサイト用のルールを新規作成"}, 9 | "preference": {"message":"設定・ルール一覧"}, 10 | "activeRules": {"message":"適用中のルール"}, 11 | "help":{"message":"ヘルプ"}, 12 | "word_group":{"message":"キーワードグループ"}, 13 | "newGroup" : {"message": "グループを作成"}, 14 | "helpKeywordGroupHeadline" : {"message": "「キーワードグループ」機能が追加されました!"}, 15 | "helpKeywordGroupDetail" : {"message": "CustomBlocker 4.0 には「キーワードグループ」が使えるようになりました。複数のキーワードのグループを登録しておくと、さまざまなルールで使用することができるようになります。"}, 16 | "sectionRuleTitle":{"message":"ルール名"}, 17 | "url":{"message":"URL"}, 18 | "sectionSite":{"message":"サイト"}, 19 | "sectionSearch":{"message":"検索範囲"}, 20 | "sectionHide":{"message":"隠す要素"}, 21 | "sectionWord":{"message":"キーワード"}, 22 | 23 | "selectOuterElement":{"message": "外側の要素を選択"}, 24 | "regex":{"message":"正規表現"}, 25 | "complete_matching":{"message":"完全一致"}, 26 | "case_sensitive":{"message":"大文字小文字を区別"}, 27 | "include_href":{"message":"リンクURLも検索"}, 28 | "exampleUrl":{"message":"URL例"}, 29 | "description":{"message":"説明"}, 30 | "descriptionHide":{"message":"「検索範囲」にキーワードが含まれていると、ここで指定した要素を非表示にします"}, 31 | "descriptionSearch":{"message":"該当する要素の中にキーワードが含まれていた場合に発動します"}, 32 | "descriptionSite":{"message":"該当するサイトでルールが適用されます"}, 33 | "prefTitle":{"message":"ルールの管理"}, 34 | "buttonLabelEdit":{"message":"編集"}, 35 | "buttonLabelDelete":{"message":"削除"}, 36 | "dialogDelete":{"message":"本当にこのルールを削除しますか?"}, 37 | "tooltipCount":{"message":"__count__件ブロックしました"}, 38 | "tooltipCountSingle":{"message":"1件ブロックしました"}, 39 | "errorTitleEmpty":{"message":"ルールのタイトルが空です。"}, 40 | "errorSiteRegexEmpty":{"message":"サイトの正規表現が空です。"}, 41 | "errorHideXpathInvalid":{"message":"ブロック対象XPathが不正です。"}, 42 | "errorSearchXpathInvalid":{"message":"検索対象XPathが不正です。"}, 43 | "saveDone":{"message":"ルールをセーブしました。"}, 44 | "wordGroupSaveDone":{"message":"グループをセーブしました。"}, 45 | "wordGroupDelete":{"message":"グループ \"___GROUP___\" を削除してもよろしいですか?"}, 46 | "manageGroups":{"message":"グループを管理"}, 47 | "errorWordGroupNameEmpty":{"message":"グループのタイトルを入力してください."}, 48 | "descriptionEmpty":{"message":"まだルールが1件もありません。
お気に入りのサイトでルールを作るか、フィルタリストからお好みのフィルタをインストールしてご利用ください。"}, 49 | "helpEmpty":{"message":"[ルールの作り方]"}, 50 | "ruleEditorExistingRules":{"message":"既存のルールに追加"}, 51 | "ruleEditorNewRules":{"message":"新しいルールを作成"}, 52 | "smartRuleEditorShowAdvancedMode":{"message":"詳細を表示"}, 53 | "smartRuleEditorHideAdvancedMode":{"message":"詳細を非表示"}, 54 | "smartRuleEditorSuggestedTitlePrefix":{"message":"パターン "}, 55 | "menuCreateRule":{"message":"この要素を使ってルールを作成"}, 56 | "menuAddToExistingRule":{"message":"既存のルールにキーワードとして追加する"}, 57 | "smartRuleEditorSuggestedButtonLabel":{"message":"作成"}, 58 | "smartRuleEditorExistingButtonLabel":{"message":"編集"}, 59 | "smartRuleEditorSuggestedMessage":{"message":"自動生成されたルールの候補です。"}, 60 | "ruleSuffix":{"message":"件"}, 61 | "unsavedDialog":{"message":"保存されていない変更があります。ダイアログを閉じると変更は失われます。本当に閉じますか?"}, 62 | "selectAll":{"message":"すべて選択"}, 63 | "blockAnyway":{"message":"無条件で隠す"}, 64 | "filterWithKeywords":{"message":"キーワードを使ってフィルタ"}, 65 | "condition":{"message":"発動条件"}, 66 | "invalidRegEx":{"message":"正しい正規表現ではありません。"}, 67 | "errorExportNoRule":{"message":"ルールが選択されていません。"}, 68 | "welcomeDone":{"message":"フィルタをインストールしました。NGワードを追加して使ってみてください!"}, 69 | "alreadyInstalled":{"message":"インストール済"}, 70 | "showBadge":{"message":"ブロックした数をアイコンの上に表示する"}, 71 | "installPreset":{"message":"おすすめルールをインストールする"}, 72 | "donate":{"message":"開発者に寄付をする"}, 73 | 74 | "migrationFlagNotFound": {"message":"バージョン2.xからのルールの移行中にトラブルが起こった可能性があります。"}, 75 | "migrationLink": {"message":"ここをクリックすると移行をやり直せます (現在保存されているルールは消えません)。"} 76 | } 77 | -------------------------------------------------------------------------------- /extension/background_page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | CustomBlocker Background Page 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /extension/css/block/button-container.css: -------------------------------------------------------------------------------- 1 | .button-container { 2 | float: right; 3 | width: 120px; 4 | height: inherit; 5 | text-align: right; 6 | height: inherit; 7 | margin: 2px 0 0; 8 | padding: 0px; 9 | width: 175px; 10 | line-height: 17px; } 11 | .button-container input { 12 | border: none; 13 | text-indent: -9999px; 14 | background: none; 15 | margin: 0 0.2rem; } 16 | .button-container input.buttonOn { 17 | background-image: url("/img/button/on.png"); 18 | background-size: 42px 13px; 19 | background-repeat: no-repeat; 20 | width: 42px; 21 | height: 13px; } 22 | .button-container input.buttonOff { 23 | background-image: url("/img/button/off.png"); 24 | background-size: 42px 13px; 25 | background-repeat: no-repeat; 26 | width: 42px; 27 | height: 13px; } 28 | .button-container input.buttonEdit { 29 | background-image: url("/img/button/edit.png"); 30 | background-size: 14px 14px; 31 | background-repeat: no-repeat; 32 | width: 14px; 33 | height: 14px; } 34 | .button-container input.buttonDelete { 35 | background-image: url("/img/button/delete.png"); 36 | background-size: 14px 14px; 37 | background-repeat: no-repeat; 38 | width: 14px; 39 | height: 14px; } 40 | 41 | /* Default visibility */ 42 | li div.button-container .exampleUrl, li div.button-container .buttonDelete, li div.button-container .buttonEdit { 43 | visibility: hidden; } 44 | 45 | /* Hover styles */ 46 | li:hover .button-container .exampleUrl, li:hover .button-container .buttonDelete, li:hover .button-container .buttonEdit { 47 | visibility: visible; } 48 | -------------------------------------------------------------------------------- /extension/css/block/customblocker-keyword.css: -------------------------------------------------------------------------------- 1 | /* Definition */ 2 | .customblocker-keyword { 3 | margin: 0px 2px 2px 0px !important; 4 | padding-left: 4px !important; 5 | padding-right: 4px !important; 6 | padding-top: 0px !important; 7 | padding-bottom: 0px !important; 8 | border-radius: 4px !important; 9 | font-size: 12px !important; 10 | display: inline-block !important; 11 | height: 14px !important; 12 | line-height: 14px !important; } 13 | .customblocker-keyword--complete-matching { 14 | background-color: #fed3de !important; 15 | border: solid 1px #fb5c86 !important; } 16 | .customblocker-keyword--not-complete-matching { 17 | background-color: #cdedf8 !important; 18 | border: solid 1px #249bc3 !important; } 19 | .customblocker-keyword--regexp { 20 | background-color: #dcc !important; 21 | border: solid 1px #baa !important; } 22 | .customblocker-keyword--not-regexp { 23 | background-color: #ccd !important; 24 | border: solid 1px #aab !important; } 25 | .customblocker-keyword__delete-button { 26 | width: 16px !important; 27 | height: 16px !important; 28 | border: none !important; 29 | background-image: url(../img/keyword_delete.png) !important; 30 | background-repeat: no-repeat; 31 | background-position: 4px 4px; 32 | background-size: 7px 7px !important; 33 | vertical-align: middle; } 34 | .customblocker-keyword__img--option { 35 | width: 13px !important; 36 | height: 13px !important; 37 | vertical-align: middle !important; 38 | margin: 0px 3px 0px 0px !important; } 39 | -------------------------------------------------------------------------------- /extension/css/block/header.css: -------------------------------------------------------------------------------- 1 | .header { 2 | padding: 0px; 3 | margin-bottom: 6px; 4 | position: relative; } 5 | .header__title { 6 | font-weight: normal; } 7 | .header__donate { 8 | text-align: right; 9 | width: 200px; 10 | height: auto; 11 | position: absolute; 12 | top: 0px; 13 | right: 0px; } 14 | .header__donate a { 15 | text-decoration: none; 16 | color: #0db3ea; 17 | font-size: 120%; } 18 | .header__tabs { 19 | height: 24px; 20 | padding: 0px; 21 | margin: 8px 0px; } 22 | .header__tabs__tab { 23 | display: block; 24 | list-style-type: none; 25 | width: 25%; 26 | height: inherit; 27 | float: left; 28 | text-align: center; 29 | color: #666; } 30 | .header__tabs__tab__link { 31 | height: inherit; 32 | display: block; 33 | text-decoration: none; 34 | line-height: 24px; 35 | color: inherit; } 36 | .header__tabs__tab--selected { 37 | background-color: #0db3ea; 38 | color: white; } 39 | -------------------------------------------------------------------------------- /extension/css/block/keyword.css: -------------------------------------------------------------------------------- 1 | /* Definition */ 2 | .customblocker-keyword, .keyword { 3 | margin: 0px 2px 2px 0px !important; 4 | padding-left: 4px !important; 5 | padding-right: 4px !important; 6 | padding-top: 0px !important; 7 | padding-bottom: 0px !important; 8 | border-radius: 4px !important; 9 | font-size: 12px !important; 10 | display: inline-block !important; 11 | height: 14px !important; 12 | line-height: 14px !important; } 13 | .customblocker-keyword--complete-matching { 14 | background-color: #fed3de !important; 15 | border: solid 1px #fb5c86 !important; } 16 | .customblocker-keyword--not-complete-matching { 17 | background-color: #cdedf8 !important; 18 | border: solid 1px #249bc3 !important; } 19 | .customblocker-keyword--regexp, .keyword--regex { 20 | background-color: #dcc !important; 21 | border: solid 1px #baa !important; } 22 | .customblocker-keyword--not-regexp { 23 | background-color: #ccd !important; 24 | border: solid 1px #aab !important; } 25 | .customblocker-keyword__delete-button { 26 | width: 16px !important; 27 | height: 16px !important; 28 | border: none !important; 29 | background-image: url(../img/keyword_delete.png) !important; 30 | background-repeat: no-repeat; 31 | background-position: 4px 4px; 32 | background-size: 7px 7px !important; 33 | vertical-align: middle; } 34 | .customblocker-keyword__img--option { 35 | width: 13px !important; 36 | height: 13px !important; 37 | vertical-align: middle !important; 38 | margin: 0px 3px 0px 0px !important; } 39 | 40 | .keyword--group { 41 | border: solid 1px #888888 !important; } 42 | 43 | .keyword--normal { 44 | background-color: #cdedf8 !important; 45 | border: solid 1px #249bc3 !important; } 46 | 47 | .keyword--block-anyway { 48 | margin-right: 4px; 49 | padding: 0px 2px; 50 | background-color: #dfd !important; 51 | border: solid 1px #4d4 !important; } 52 | -------------------------------------------------------------------------------- /extension/css/block/rule-list.css: -------------------------------------------------------------------------------- 1 | .rule-list { 2 | padding: 0px; 3 | margin: 0px; 4 | font-size: 12px; } 5 | .rule-list__item__information { 6 | margin-right: 100px; 7 | height: inherit; } 8 | .rule-list__item__information img.favicon { 9 | position: absolute; 10 | left: 2px; 11 | top: 2px; } 12 | .rule-list__item__information div.title { 13 | position: absolute; 14 | line-height: 16px; 15 | vertical-align: middle; 16 | left: 20px; 17 | top: 2px; 18 | height: 16px; 19 | font-size: 12px; } 20 | .rule-list__item__information div.url { 21 | position: absolute; 22 | font-size: 10px; 23 | left: 10px; 24 | top: 20px; 25 | color: #444; } 26 | .rule-list__item__information div.keywords { 27 | position: absolute; 28 | font-size: 9px; 29 | left: 250px; 30 | top: 22px; } 31 | .rule-list li { 32 | height: 37px; 33 | list-style-type: none; 34 | margin: 0px; 35 | padding: 0px; 36 | position: relative; 37 | cursor: pointer; 38 | overflow: hidden; 39 | color: #444; 40 | border-top: 1px solid #ddd; } 41 | .rule-list li:last-child { 42 | border-bottom: 1px solid #ddd; } 43 | .rule-list li:hover { 44 | background-color: #eef8ff; } 45 | .rule-list li .exampleUrl { 46 | background-image: url("/img/button/link.png"); 47 | background-size: 14px 14px; 48 | background-repeat: no-repeat; 49 | width: 14px; 50 | height: 14px; 51 | display: inline-block; } 52 | .rule-list li .sub_import { 53 | position: absolute; 54 | left: 50px; 55 | top: 0px; 56 | width: 400px; } 57 | .rule-list li .sub_export { 58 | position: absolute; 59 | left: 36px; 60 | top: 0px; 61 | width: 400px; } 62 | .rule-list li img.importIcon { 63 | position: absolute; 64 | left: 34px; 65 | top: 2px; } 66 | .rule-list li input.check { 67 | position: absolute; 68 | left: 10px; 69 | top: 10px; } 70 | .rule-list li.filtered { 71 | display: none; } 72 | .rule-list li.selected { 73 | background-color: #fff080; } 74 | .rule-list .keywords { 75 | clear: right; } 76 | -------------------------------------------------------------------------------- /extension/css/block/var.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/css/block/var.css -------------------------------------------------------------------------------- /extension/css/context/keywords.css: -------------------------------------------------------------------------------- 1 | /* Definition */ 2 | .customblocker-keyword, #smart_rule_editor_keywords span.word, #smart_rule_editor_preview_keywords span.word { 3 | margin: 0px 2px 2px 0px !important; 4 | padding-left: 4px !important; 5 | padding-right: 4px !important; 6 | padding-top: 0px !important; 7 | padding-bottom: 0px !important; 8 | border-radius: 4px !important; 9 | font-size: 12px !important; 10 | display: inline-block !important; 11 | height: 14px !important; 12 | line-height: 14px !important; } 13 | .customblocker-keyword--complete-matching, #smart_rule_editor_keywords span.complete_matching, #smart_rule_editor_preview_keywords span.complete_matching { 14 | background-color: #fed3de !important; 15 | border: solid 1px #fb5c86 !important; } 16 | .customblocker-keyword--not-complete-matching, #smart_rule_editor_keywords span.not_complete_matching, #smart_rule_editor_preview_keywords span.not_complete_matching { 17 | background-color: #cdedf8 !important; 18 | border: solid 1px #249bc3 !important; } 19 | .customblocker-keyword--regexp { 20 | background-color: #dcc !important; 21 | border: solid 1px #baa !important; } 22 | .customblocker-keyword--not-regexp { 23 | background-color: #ccd !important; 24 | border: solid 1px #aab !important; } 25 | .customblocker-keyword__delete-button, #smart_rule_editor_keywords span.word .deleteButton, #smart_rule_editor_preview_keywords span.word .deleteButton { 26 | width: 16px !important; 27 | height: 16px !important; 28 | border: none !important; 29 | background-image: url(../img/keyword_delete.png) !important; 30 | background-repeat: no-repeat; 31 | background-position: 4px 4px; 32 | background-size: 7px 7px !important; 33 | vertical-align: middle; } 34 | .customblocker-keyword__img--option, #smart_rule_editor_keywords span.word img.option, #smart_rule_editor_preview_keywords span.word img.option { 35 | width: 13px !important; 36 | height: 13px !important; 37 | vertical-align: middle !important; 38 | margin: 0px 3px 0px 0px !important; } 39 | 40 | /* For content scripts (Strong) */ 41 | -------------------------------------------------------------------------------- /extension/css/context/reset.css: -------------------------------------------------------------------------------- 1 | #smart_rule_editor_container, #rule_editor_container { 2 | all: initial; } 3 | #smart_rule_editor_container *, #rule_editor_container * { 4 | all: initial; } 5 | 6 | #smart_rule_editor_container div, 7 | #rule_editor_container div { 8 | display: block; } 9 | -------------------------------------------------------------------------------- /extension/css/context/rule_editor_cursor.css: -------------------------------------------------------------------------------- 1 | body { 2 | cursor: crosshair !important; } 3 | -------------------------------------------------------------------------------- /extension/css/help.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | font-size: 130%; 3 | font-weight: normal; 4 | padding-left: 4px; 5 | padding-top: 10px; } 6 | 7 | p { 8 | /*font-size:90%;*/ 9 | color: #222; 10 | padding: 2px 4px; 11 | margin: 2px 2px; } 12 | -------------------------------------------------------------------------------- /extension/css/help_small.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | body { 3 | margin: 0px; 4 | padding: 0px; 5 | font-family: 'Hiragino Kaku Gothic ProN','ヒラギノ角ゴ ProN W3','YuGothic','Yu Gothic','メイリオ','Meiryo','MS ゴシック','Lucida Grande', 'Helvetica', 'Arial', sans-serif; } 6 | 7 | .header { 8 | height: 30px; 9 | background-color: #ddd; 10 | line-height: 30px; } 11 | .header .menu { 12 | width: 260px; 13 | height: inherit; 14 | float: right; 15 | text-align: right; } 16 | 17 | p { 18 | margin: 4px; } 19 | 20 | h1 { 21 | font-size: 110%; 22 | border-bottom: solid 1px #888; 23 | background-color: #eee; 24 | font-weight: normal; 25 | margin: 0px; 26 | padding: 0px 4px; 27 | -webkit-box-shadow: 1px 0px 2px #444; } 28 | 29 | p { 30 | font-size: 90%; 31 | color: #222; 32 | padding: 4px; } 33 | 34 | ul { 35 | font-size: 90%; 36 | color: #222; } 37 | -------------------------------------------------------------------------------- /extension/css/index.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | .button-container { 3 | float: right; 4 | width: 120px; 5 | height: inherit; 6 | text-align: right; 7 | height: inherit; 8 | margin: 2px 0 0; 9 | padding: 0px; 10 | width: 175px; 11 | line-height: 17px; } 12 | .button-container input { 13 | border: none; 14 | text-indent: -9999px; 15 | background: none; 16 | margin: 0 0.2rem; } 17 | .button-container input.buttonOn { 18 | background-image: url("/img/button/on.png"); 19 | background-size: 42px 13px; 20 | background-repeat: no-repeat; 21 | width: 42px; 22 | height: 13px; } 23 | .button-container input.buttonOff { 24 | background-image: url("/img/button/off.png"); 25 | background-size: 42px 13px; 26 | background-repeat: no-repeat; 27 | width: 42px; 28 | height: 13px; } 29 | .button-container input.buttonEdit { 30 | background-image: url("/img/button/edit.png"); 31 | background-size: 14px 14px; 32 | background-repeat: no-repeat; 33 | width: 14px; 34 | height: 14px; } 35 | .button-container input.buttonDelete { 36 | background-image: url("/img/button/delete.png"); 37 | background-size: 14px 14px; 38 | background-repeat: no-repeat; 39 | width: 14px; 40 | height: 14px; } 41 | 42 | /* Default visibility */ 43 | li div.button-container .exampleUrl, li div.button-container .buttonDelete, li div.button-container .buttonEdit { 44 | visibility: hidden; } 45 | 46 | /* Hover styles */ 47 | li:hover .button-container .exampleUrl, li:hover .button-container .buttonDelete, li:hover .button-container .buttonEdit { 48 | visibility: visible; } 49 | 50 | body { 51 | margin: 0px; 52 | padding: 0px; 53 | font-family: 'Hiragino Kaku Gothic ProN','ヒラギノ角ゴ ProN W3','YuGothic','Yu Gothic','メイリオ','Meiryo','MS ゴシック','Lucida Grande', 'Helvetica', 'Arial', sans-serif; } 54 | 55 | .header { 56 | height: 30px; 57 | line-height: 30px; 58 | padding-top: 7px; 59 | padding-right: 6px; } 60 | .header .menu { 61 | width: 280px; 62 | height: inherit; 63 | float: right; 64 | text-align: right; 65 | font-size: 10px; } 66 | .header h1 { 67 | font-size: 1.4px; 68 | margin-right: 200px; 69 | width: auto; 70 | margin-top: 0px; 71 | margin-left: 0px; 72 | margin-bottom: 0px; 73 | padding: 0px; 74 | height: inherit; 75 | color: #333; 76 | margin-left: 4px; 77 | font-weight: normal; } 78 | 79 | a { 80 | text-decoration: none; 81 | color: #0db3ea; 82 | font-size: 120%; } 83 | 84 | #content { 85 | padding: 7px; } 86 | 87 | h2 { 88 | font-size: 12px; 89 | width: auto; 90 | margin-top: 0px; 91 | margin-left: 0px; 92 | margin-bottom: 0px; 93 | padding: 0px; 94 | font-weight: normal; 95 | display: inline; } 96 | 97 | /* 98 | Applied Rules 99 | */ 100 | #ruleSection { 101 | margin-bottom: 6px; } 102 | 103 | #ruleSectionHeader { 104 | line-height: 22px; 105 | height: 22px; 106 | color: #333; 107 | font-weight: bold; 108 | text-indent: 4px; 109 | font-size: 13px; 110 | border-bottom: solid 1px #ddd; } 111 | 112 | #ruleSectionFooter { 113 | text-align: right; } 114 | 115 | #ruleSectionFooter a { 116 | color: #666; 117 | font-size: 80%; 118 | padding-right: 6px; 119 | text-decoration: none; } 120 | 121 | .rule-list li { 122 | height: 24px; 123 | list-style-type: none; 124 | margin: 0px; 125 | padding: 0px; 126 | position: relative; 127 | clear: both; } 128 | 129 | #activeRules { 130 | margin: 0px; 131 | padding: 0px; } 132 | #activeRules li { 133 | height: 27px; 134 | line-height: 27px; 135 | list-style-type: none; 136 | clear: both; 137 | font-size: 90%; 138 | background-color: #fff; 139 | border-bottom: 1px solid #ddd; } 140 | #activeRules li .title { 141 | margin-left: 25px; 142 | margin-right: 122px; 143 | vertical-align: middle; 144 | height: inherit; 145 | color: #222; } 146 | #activeRules li .count { 147 | height: 14px; 148 | margin-top: 6px; 149 | line-height: 14px; 150 | margin-left: 2px; 151 | margin-right: 2px; 152 | width: 18px; 153 | text-align: center; 154 | color: white; 155 | font-size: 10px; 156 | float: left; } 157 | #activeRules li .hit { 158 | background-color: #fe376c; } 159 | #activeRules li .noHit { 160 | background-color: #959595; } 161 | #activeRules li.empty { 162 | line-height: 24px; 163 | font-size: 80%; 164 | text-indent: 4px; 165 | color: #444; } 166 | 167 | #version { 168 | color: #444; 169 | text-align: right; 170 | float: right; 171 | width: 100px; 172 | font-size: 80%; 173 | line-height: 150%; } 174 | 175 | #buttonCreateRule { 176 | color: #666666; 177 | background-image: url(../img/button/add.png) !important; 178 | background-repeat: no-repeat; 179 | background-size: 16px 16px; 180 | text-indent: 20px; 181 | display: inline-block; 182 | height: 16px; 183 | font-size: 14px; 184 | text-decoration: none; 185 | margin: 0.5em 0; } 186 | #buttonCreateRule:hover { 187 | text-decoration: underline; } 188 | 189 | .note { 190 | background-color: #cdedf8 !important; 191 | border: solid 1px #249bc3 !important; 192 | padding: 0.5em; 193 | position: relative; 194 | color: #249bc3; 195 | display: none; } 196 | .note__link { 197 | color: #249bc3; } 198 | .note__dismiss { 199 | display: inline-block; 200 | width: 16px; 201 | height: 16px; 202 | background-image: url(../../img/keyword_delete.png) !important; 203 | background-repeat: no-repeat; 204 | background-position: 4px 4px; 205 | background-size: 7px 7px !important; 206 | text-indent: -9999px; 207 | position: absolute; 208 | top: 0; 209 | right: 0; } 210 | -------------------------------------------------------------------------------- /extension/css/keywords.css: -------------------------------------------------------------------------------- 1 | /* Definition */ 2 | .customblocker-keyword, #rule_editor_keywords .word, #rule_editor_keywords .group, #rule_editor_keyword_groups .word, #rule_editor_keyword_groups .group { 3 | margin: 0px 2px 2px 0px !important; 4 | padding-left: 4px !important; 5 | padding-right: 4px !important; 6 | padding-top: 0px !important; 7 | padding-bottom: 0px !important; 8 | border-radius: 4px !important; 9 | font-size: 12px !important; 10 | display: inline-block !important; 11 | height: 14px !important; 12 | line-height: 14px !important; } 13 | .customblocker-keyword--complete-matching, #rule_editor_keywords .word--complete-matching, #rule_editor_keywords .group--complete-matching, #rule_editor_keyword_groups .word--complete-matching, #rule_editor_keyword_groups .group--complete-matching { 14 | background-color: #fed3de !important; 15 | border: solid 1px #fb5c86 !important; } 16 | .customblocker-keyword--not-complete-matching, #rule_editor_keywords .word--not-complete-matching, #rule_editor_keywords .group--not-complete-matching, #rule_editor_keyword_groups .word--not-complete-matching, #rule_editor_keyword_groups .group--not-complete-matching { 17 | background-color: #cdedf8 !important; 18 | border: solid 1px #249bc3 !important; } 19 | .customblocker-keyword--regexp, #rule_editor_container .block_anyway .regexp { 20 | background-color: #dcc !important; 21 | border: solid 1px #baa !important; } 22 | .customblocker-keyword--not-regexp, #rule_editor_container .block_anyway .not_regexp { 23 | background-color: #ccd !important; 24 | border: solid 1px #aab !important; } 25 | .customblocker-keyword__delete-button, #rule_editor_keywords .word__delete-button, #rule_editor_keywords .group__delete-button, #rule_editor_keyword_groups .word__delete-button, #rule_editor_keyword_groups .group__delete-button { 26 | width: 16px !important; 27 | height: 16px !important; 28 | border: none !important; 29 | background-image: url(../img/keyword_delete.png) !important; 30 | background-repeat: no-repeat; 31 | background-position: 4px 4px; 32 | background-size: 7px 7px !important; 33 | vertical-align: middle; } 34 | .customblocker-keyword__img--option, #rule_editor_keywords .word .option, #rule_editor_keywords .group .option, #rule_editor_keyword_groups .word .option, #rule_editor_keyword_groups .group .option { 35 | width: 13px !important; 36 | height: 13px !important; 37 | vertical-align: middle !important; 38 | margin: 0px 3px 0px 0px !important; } 39 | 40 | /** 41 | Keyword Container 42 | (for keyword) 43 | */ 44 | .rule_editor_keywords { 45 | padding: 2px 5px 2px 15px !important; } 46 | 47 | /* For extension paths (Weak) */ 48 | #rule_editor_keywords .group, #rule_editor_keyword_groups .group { 49 | border: solid 1px #888888 !important; } 50 | 51 | /* Block anyway (Only in list) */ 52 | -------------------------------------------------------------------------------- /extension/css/pref/help.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | font-size: 130%; 3 | font-weight: normal; 4 | padding-left: 4px; 5 | padding-top: 10px; } 6 | 7 | p { 8 | /* font-size:90%; */ 9 | color: #222; 10 | padding: 2px 4px; 11 | margin: 2px 2px; } 12 | -------------------------------------------------------------------------------- /extension/css/reset.css: -------------------------------------------------------------------------------- 1 | #smart_rule_editor_container, #rule_editor_container { 2 | all: initial; } 3 | #smart_rule_editor_container *, #rule_editor_container * { 4 | all: initial; } 5 | 6 | #smart_rule_editor_container div, 7 | #rule_editor_container div { 8 | display: block; } 9 | -------------------------------------------------------------------------------- /extension/css/rule_editor_cursor.css: -------------------------------------------------------------------------------- 1 | body { 2 | cursor: crosshair !important; } 3 | -------------------------------------------------------------------------------- /extension/css/welcome_install.css: -------------------------------------------------------------------------------- 1 | ul.sites { 2 | border: 1px solid #888; 3 | height: 420px; 4 | overflow-y: auto; 5 | list-style-type: none; 6 | padding-left: 8px; 7 | line-height: 100%; } 8 | 9 | ul.sites > li > ul { 10 | list-style-type: none; 11 | -webkit-transition: height .1s linear; 12 | overflow-y: hidden; } 13 | 14 | ul.sites > li.duplicate { 15 | color: #888; } 16 | 17 | ul.sites > li > ul > li { 18 | height: 18px; } 19 | 20 | ul.sites > li > ul > li.done, 21 | ul.sites > li > ul > li.duplicate { 22 | color: #888; } 23 | 24 | ul.sites li span.installed { 25 | background-color: #66f; 26 | color: #fff; 27 | margin-left: 8px; 28 | padding: 1px; 29 | font-size: 60%; } 30 | 31 | input.openButton { 32 | width: 13px; 33 | height: 13px; 34 | border: none; } 35 | 36 | input.plus { 37 | background-image: url(../img/open_plus.png); } 38 | 39 | input.minus { 40 | background-image: url(../img/open_minus.png); } 41 | 42 | div.presetSection { 43 | padding: 4px; } 44 | 45 | div.presetSection ul.sites { 46 | margin: 2px; } 47 | 48 | input.buttonUse { 49 | font-size: 120%; 50 | margin-top: 4px; } 51 | -------------------------------------------------------------------------------- /extension/help/en/block_anyway.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | How "Block Anyway" option works | CustomBlocker Help 7 | 8 | 9 |

How "Block Anyway" option works

10 |

11 | When "Block Anyway" is checked, elements selected by XPath of "Elements to Hide" will be hidden, whether keywords are contained or not. 12 |

13 |

14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /extension/help/en/hide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | How "Elements to Hide" property works | CustomBlocker Help 7 | 8 | 9 |

How "Elements to Hide" property works

10 |

11 | This XPath specifies which elements should be hidden. 12 | Selected elements will be hidden if they contain any element with keywords. 13 |

14 |

15 | 16 |

17 |

18 | You can get XPaths easily by clicking "Suggest" and click one of target elements. 19 | Some XPaths which can select similar elements are suggested. 20 |

21 |

22 | 23 |

24 |

25 | When "Block Anyway" is checked, elements selected by XPath of "Elements to Hide" will be hidden, whether keywords are contained or not. 26 |

27 | 28 | 29 | -------------------------------------------------------------------------------- /extension/help/en/keywords.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Keywords | CustomBlocker Help 7 | 8 | 9 |

Keywords

10 |

11 | The rule works when "elements to hide" contain any keyword. 12 |

13 |

14 | 15 |

16 |

17 | You can chose two type of keyword. 18 | If "RegEx" checkbox is not checked, the rule works when texts in "elements to hide" contain the word simply. 19 | If you check "RegEx" checkbox it works when the regular expression matches the content. 20 |

21 |

22 | 23 |

24 |

25 | Simple words are shown in blue strip and RegEx words are shown in red strip. 26 |

27 |

28 | You can delete a word by clicking [x] button. 29 | When "Block Anyway" is checked, elements selected by XPath of "Elements to Hide" will be hidden, whether keywords are contained or not. 30 |

31 | 32 | 33 | -------------------------------------------------------------------------------- /extension/help/en/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | How "Search Region" property works | CustomBlocker Help 7 | 8 | 9 |

How "Search Region" property works

10 |

11 | This XPath expression specifies in which elements this extension search for keywords. 12 | If some of specified elements contain keyword and the elements are contained by "Elements to Hide", the rule works and "Elements to Hide" will be hidden. 13 |

14 |

15 | 16 |

17 |

18 | You can get XPaths easily by clicking "Suggest" and click one of target elements. 19 | Some XPaths which can select similar elements are suggested. 20 |

21 |

22 | 23 |

24 |

25 | When "Block Anyway" is checked this property is useless because elements selected by XPath of "Elements to Hide" will be hidden, whether keywords are contained or not. 26 |

27 | 28 | 29 | -------------------------------------------------------------------------------- /extension/help/en/site.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Site | CustomBlocker Help 7 | 8 | 9 |

Site

10 |

11 | This property specifies URLs on which the rule works. 12 | When you are browsing a web site and the URL matches the expression, the rule will work. 13 | For example, 14 |

15 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /extension/help/en/smart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Smart Rule Creator | CustomBlocker Help 7 | 8 | 9 |

Smart Rule Creator

10 |

11 | You can create rules by right-clicking on elements in web pages. 12 | CustomBlocker will analyze structure of web sites and suggest some rules. 13 |

14 |

15 | 16 |

17 |

18 | You can test rules by moving the cursor on lines. Elements which will be searched or be hidden are highlighted. 19 |

20 |

21 | 22 |

23 |

24 | Click a rule if you like and you can add keywords and edit details. 25 |

26 |

27 | 28 |

29 | 30 | 31 | -------------------------------------------------------------------------------- /extension/help/ja/block_anyway.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 「無条件で隠す」の機能 | CustomBlocker Help 7 | 8 | 9 |

「無条件で隠す」の機能

10 |

11 | 「無条件で隠す」チェックボックスにチェックを入れると、検索範囲やキーワードにかかわらず、「隠す要素」のXPathにヒットした要素が隠されます。 12 |

13 |

14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /extension/help/ja/hide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 隠す要素 | CustomBlocker Help 7 | 8 | 9 |

隠す要素

10 |

11 | 非表示にする要素をXPathによって指定します。 12 | キーワードのどれかが含まれていた場合、非表示となります。さらに厳密な設定を行いたい場合は、キーワードに加えて「検索範囲」を指定してください。「検索範囲」にキーワードが含まれていた場合にのみ、フィルタが発動するようになります。 13 |

14 |

15 | 16 |

17 |

18 | 「隠す要素」はXPathによって指定します。 19 | 「XPathを取得」ボタンを押すことで、簡単にXPathの候補を表示することができます。「XPathを取得」ボタンを押し、選択したい要素をクリックしてください。類似した要素をピックアップできるXPath候補がいくつか表示されます。 20 |

21 |

22 | 23 |

24 |

25 | 左端に表示されている数字は、表示中のページの中でそのXPathにヒットする要素の数です。カーソルを合わせると、該当する要素がハイライトされますので、意図した通りの要素がヒットするようなXPathを選んでルールを作成してください。 26 | なお、表示されたXPath候補以外のXPathを直接テキストボックスに書くこともできます。 27 |

28 |

29 | 「説明」の欄はメモに利用してください。 30 |

31 | 32 | 33 | -------------------------------------------------------------------------------- /extension/help/ja/keywords.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | キーワード | CustomBlocker Help 7 | 8 | 9 |

キーワード

10 |

11 | キーワードの含まれる「隠す要素」がフィルタの対象となります。 12 | さらに厳密な設定を行いたい場合は、キーワードに加えて「検索範囲」を指定してください。「検索範囲」にキーワードが含まれていた場合にのみ、フィルタが発動するようになります。 13 |

14 |

15 | 16 |

17 |

18 | キーワードの判定方法には「単純一致」と「正規表現に一致」の2種類があります。 19 | 「正規表現」チェックボックスにチェックを入れない場合、単純にその文字列が含まれるかどうかがチェックされます。 20 | 一方、チェックが入っている場合は、その正規表現に一致するかどうかがチェックされます。 21 | 「単純一致」のキーワードは青、「正規表現に一致」のキーワードは赤で表示されます。 22 |

23 |

24 | 25 |

26 |

27 | キーワードを削除するには、右端の[x]ボタンをクリックします。 28 |

29 | 30 | 31 | -------------------------------------------------------------------------------- /extension/help/ja/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 検索範囲 | CustomBlocker Help 7 | 8 | 9 |

検索範囲

10 |

11 | このXPathによってヒットした要素にキーワードが含まれているとき、その要素を含んだ「隠す要素」が非表示になります。 12 | 「隠す要素」と同じか、もしくは「隠す要素」に含まれる要素を選んでください。 13 |

14 |

15 | 16 |

17 |

18 | 「検索範囲」はXPathによって指定します。 19 | 「XPathを取得」ボタンを押すことで、簡単にXPathの候補を表示することができます。「XPathを取得」ボタンを押し、選択したい要素をクリックしてください。類似した要素をピックアップできるXPath候補がいくつか表示されます。 20 |

21 |

22 | 23 |

24 |

25 | 左端に表示されている数字は、表示中のページの中でそのXPathにヒットする要素の数です。カーソルを合わせると、該当する要素がハイライトされますので、意図した通りの要素がヒットするようなXPathを選んでルールを作成してください。 26 | なお、表示されたXPath候補以外のXPathを直接テキストボックスに書くこともできます。 27 |

28 |

29 | なお、「無条件で隠す」がチェックされている場合、キーワードがヒットするかどうかを確認せず、「隠す要素」を非表示にします。 30 | その場合はこの「検索範囲」を指定する必要はありません。 31 |

32 |

33 | 「説明」の欄はメモに利用してください。 34 |

35 | 36 | 37 | -------------------------------------------------------------------------------- /extension/help/ja/site.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | サイト | CustomBlocker Help 7 | 8 | 9 |

サイト

10 |

11 | 「どのサイトでルールが適用されるか」を指定します。 12 | 正規表現に合致するサイトでルールが適用されます。たとえば…… 13 |

14 | 18 |

19 | 「URL例」と「説明」の欄はメモに利用してください。ルール一覧ページからは「URL例」にリンクされます。 20 |

21 | 22 | 23 | -------------------------------------------------------------------------------- /extension/help/ja/smart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ルールの作成 | CustomBlocker Help 7 | 8 | 9 |

ルールの作成

10 |

11 | Webサイト上の要素の上で右クリックをし、「この要素を使ってルールを作成」のメニューを選ぶと、CustomBlockerはページの構造を解析し、いくつかのルールの候補を表示します。 12 |

13 |

14 | 15 |

16 |

17 | 表示されたルールにマウスのカーソルを合わせると、そのルールの対象となる要素がハイライトされます。 18 |

19 |

20 | 21 |

22 |

23 | 気に入ったルールをクリックすると、キーワードを追加したり、ルールの詳細を編集したりすることができます。 24 |

25 |

26 | 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /extension/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/icon/icon.png -------------------------------------------------------------------------------- /extension/icon/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/icon/icon128.png -------------------------------------------------------------------------------- /extension/icon/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/icon/icon32.png -------------------------------------------------------------------------------- /extension/icon/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/icon/icon48.png -------------------------------------------------------------------------------- /extension/icon/icon_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/icon/icon_disabled.png -------------------------------------------------------------------------------- /extension/img/button/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/add.png -------------------------------------------------------------------------------- /extension/img/button/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/delete.png -------------------------------------------------------------------------------- /extension/img/button/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/edit.png -------------------------------------------------------------------------------- /extension/img/button/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/link.png -------------------------------------------------------------------------------- /extension/img/button/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/off.png -------------------------------------------------------------------------------- /extension/img/button/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/button/on.png -------------------------------------------------------------------------------- /extension/img/help/blocked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/blocked.png -------------------------------------------------------------------------------- /extension/img/help/help1-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help1-en.png -------------------------------------------------------------------------------- /extension/img/help/help1-ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help1-ja.png -------------------------------------------------------------------------------- /extension/img/help/help2-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help2-en.png -------------------------------------------------------------------------------- /extension/img/help/help2-ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help2-ja.png -------------------------------------------------------------------------------- /extension/img/help/help3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help3.png -------------------------------------------------------------------------------- /extension/img/help/help4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/help4.png -------------------------------------------------------------------------------- /extension/img/help/new_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/new_ui.png -------------------------------------------------------------------------------- /extension/img/help/old_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/old_ui.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-detail-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-detail-en.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-detail-ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-detail-ja.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-en.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-ja.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-list-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-list-en.png -------------------------------------------------------------------------------- /extension/img/help/rightclick-list-ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help/rightclick-list-ja.png -------------------------------------------------------------------------------- /extension/img/help_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/help_icon.png -------------------------------------------------------------------------------- /extension/img/icon_regexp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/icon_regexp.png -------------------------------------------------------------------------------- /extension/img/icon_upper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/icon_upper.png -------------------------------------------------------------------------------- /extension/img/import_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/import_add.png -------------------------------------------------------------------------------- /extension/img/import_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/import_update.png -------------------------------------------------------------------------------- /extension/img/keyword_case_sensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_case_sensitive.png -------------------------------------------------------------------------------- /extension/img/keyword_case_sensitive_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_case_sensitive_blue.png -------------------------------------------------------------------------------- /extension/img/keyword_case_sensitive_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_case_sensitive_red.png -------------------------------------------------------------------------------- /extension/img/keyword_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_delete.png -------------------------------------------------------------------------------- /extension/img/keyword_include_href.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_include_href.png -------------------------------------------------------------------------------- /extension/img/keyword_include_href_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_include_href_blue.png -------------------------------------------------------------------------------- /extension/img/keyword_include_href_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_include_href_red.png -------------------------------------------------------------------------------- /extension/img/keyword_regexp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_regexp.png -------------------------------------------------------------------------------- /extension/img/keyword_regexp_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_regexp_blue.png -------------------------------------------------------------------------------- /extension/img/keyword_regexp_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/keyword_regexp_red.png -------------------------------------------------------------------------------- /extension/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/loading.gif -------------------------------------------------------------------------------- /extension/img/open_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/open_minus.png -------------------------------------------------------------------------------- /extension/img/open_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/open_plus.png -------------------------------------------------------------------------------- /extension/img/rule_editor_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/rule_editor_close.png -------------------------------------------------------------------------------- /extension/img/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/search_icon.png -------------------------------------------------------------------------------- /extension/img/smart_path_preview_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/smart_path_preview_img.png -------------------------------------------------------------------------------- /extension/img/title_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/title_small.png -------------------------------------------------------------------------------- /extension/img/top_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/top_title.png -------------------------------------------------------------------------------- /extension/img/wand_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/wand_transparent.png -------------------------------------------------------------------------------- /extension/img/word_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/word_delete.png -------------------------------------------------------------------------------- /extension/img/word_delete_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/word_delete_hover.png -------------------------------------------------------------------------------- /extension/img/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/world.png -------------------------------------------------------------------------------- /extension/img/xpath_picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maripo/CustomFilter/46653c33a63549039f7634e559f5eb6e5884bef2/extension/img/xpath_picker.png -------------------------------------------------------------------------------- /extension/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | CustomBlocker 9 | 10 | 11 | 21 |
22 |
23 |
24 |

Active Rules

25 |
26 | 28 |
29 |
Version
30 |
31 | Create a new rule for this site 33 |
34 | 35 |
36 | "Keyword groups" feature is supported in version 4.x! 37 | x 38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name" : "CustomBlocker", 4 | "version" : "4.1.4", 5 | "default_locale": "en", 6 | "description" : "__MSG_extDescription__", 7 | "browser_action": { 8 | "default_title": "CustomBlocker preference", 9 | "default_icon": "icon/icon_disabled.png", 10 | "default_popup": "index.html" 11 | }, 12 | "options_page":"pref/index.html", 13 | "background": { 14 | "page":"background_page.html" 15 | }, 16 | "web_accessible_resources": [ 17 | "css/context/reset.css", 18 | "css/rule_editor_common.css", 19 | "css/rule_editor.css", 20 | "css/context/smart_rule_editor.css", 21 | "css/context/keywords.css", 22 | "css/context/rule_editor_cursor.css", 23 | 24 | "img/loading.gif", 25 | "img/smart_path_preview_img.png", 26 | "img/word_delete.png", 27 | "img/word_delete_hover.png", 28 | "img/rule_editor_close.png", 29 | "img/wand.png", 30 | "img/wand_transparent.png", 31 | "img/icon_upper.png", 32 | "img/help_icon.png", 33 | "img/icon_regexp.png", 34 | "img/keyword_delete.png", 35 | "img/keyword_case_sensitive_red.png", 36 | "img/keyword_include_href_red.png", 37 | "img/keyword_regexp_red.png", 38 | "img/keyword_case_sensitive_blue.png", 39 | "img/keyword_include_href_blue.png", 40 | "img/keyword_regexp_blue.png", 41 | 42 | "rule_editor_frame_ja.html", 43 | "rule_editor_frame_en.html", 44 | "en/rule_editor_frame.html", 45 | "ja/rule_editor_frame.html" 46 | ], 47 | "content_scripts" : [ 48 | { 49 | "matches" : [ 50 | "http://*/*", 51 | "https://*/*" 52 | ], 53 | "js" : 54 | [ 55 | "src/util.js","src/uuid.js", 56 | "src/element_highlighter.js", 57 | "src/db/DbObj.js","src/db/Rule.js", "src/db/Word.js", 58 | "src/rule/Storage.js", "src/rule/Rule.js", "src/rule/Word.js", "src/rule/WordGroup.js", 59 | "src/rule_executor.js", "src/contentscript.js", 60 | "src/smart_path_analyzer.js", 61 | "src/rule_editor.js", 62 | "src/smart_rule_editor.js", 63 | "src/path_analyzer.js", 64 | "src/xpath_builder.js", "src/css_builder.js" 65 | ], 66 | "run_at" : "document_idle", 67 | "all_frames" : false 68 | } 69 | ], 70 | "permissions" : [ 71 | "background", 72 | "tabs", 73 | "storage", 74 | "contextMenus", 75 | "chrome://favicon/", 76 | "unlimitedStorage" 77 | ] 78 | , 79 | "icons" : { 80 | "128" : "icon/icon128.png", 81 | "48" : "icon/icon48.png", 82 | "32" : "icon/icon32.png" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /extension/pref/welcome_en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome | CustomBlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | -------------------------------------------------------------------------------- /extension/pref/welcome_ja.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome | CustomBlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /extension/pref/word_group.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Word Groups | CustomBlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

CustomBlocker for Google Chrome

18 |
19 | 24 |
25 |
"Keyword groups" feature is supported in version 4.x!x
26 |
27 | 28 |
29 |
30 |
31 |
32 |

Title

33 | 34 |
35 |
36 |

Words

37 |
38 | 39 | 40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
55 |
56 |
57 |
58 | 59 |
60 |
61 | 62 |
63 |
64 | 65 |
66 |
67 |
New group
68 |
    69 |
    70 |
    71 |
    72 | 73 | -------------------------------------------------------------------------------- /extension/src/analytics.js: -------------------------------------------------------------------------------- 1 | var _gaq = _gaq || []; 2 | _gaq.push(['_setAccount', 'UA-877593-4']); 3 | _gaq.push(['_trackPageview']); 4 | (function () { 5 | var ga = document.createElement('script'); 6 | ga.type = 'text/javascript'; 7 | ga.async = true; 8 | ga.src = 'https://ssl.google-analytics.com/ga.js'; 9 | var s = document.getElementsByTagName('script')[0]; 10 | s.parentNode.insertBefore(ga, s); 11 | })(); 12 | var Analytics = (function () { 13 | function Analytics() { 14 | } 15 | Analytics.trackEvent = function (key, value) { 16 | _gaq.push(['_trackEvent', key, value]); 17 | }; 18 | return Analytics; 19 | }()); 20 | //# sourceMappingURL=analytics.js.map -------------------------------------------------------------------------------- /extension/src/contentscript.js: -------------------------------------------------------------------------------- 1 | var timeZero = new Date().getTime(); 2 | function elapsed() { 3 | return new Date().getTime() - timeZero; 4 | } 5 | var customBlockerBgCallback = null; 6 | window.ruleEditor = null; 7 | var BackgroundCommunicator = (function () { 8 | function BackgroundCommunicator() { 9 | } 10 | BackgroundCommunicator.prototype.sendRequest = function (command, param) { 11 | param.command = command; 12 | this.bgPort.postMessage({ command: command, param: param }); 13 | }; 14 | BackgroundCommunicator.prototype.processBackgroundRequest = function (request, sender, sendResponse) { 15 | customBlockerBgCallback = sendResponse; 16 | switch (request.command) { 17 | case 'init': 18 | this.execInit(request); 19 | break; 20 | case 'highlight': 21 | this.execHighlight(request); 22 | break; 23 | case 'ruleEditor': 24 | this.execRuleEditor(request); 25 | break; 26 | case 'ruleSaveDoneRuleSmart': 27 | this.execRuleSaveDoneSmartEditor(request); 28 | break; 29 | case 'stop': 30 | this.execStop(request); 31 | break; 32 | case 'resume': 33 | this.execResume(request); 34 | break; 35 | case 'reload': 36 | console.log("Reloaded."); 37 | this.execReloadDelayed(request); 38 | break; 39 | case 'quickRuleCreation': 40 | this.execQuickRuleCreation(request); 41 | break; 42 | } 43 | }; 44 | BackgroundCommunicator.prototype.execInit = function (request) { 45 | var allRules = request.rules; 46 | if (window.customBlockerInitDone) 47 | return; 48 | window.customBlockerInitDone = true; 49 | rules = new Array(); 50 | RuleExecutor.checkRules(allRules); 51 | }; 52 | BackgroundCommunicator.prototype.execHighlight = function (request) { 53 | window.elementHighlighter.highlightRule(request.rule); 54 | }; 55 | BackgroundCommunicator.prototype.execRuleEditor = function (request) { 56 | if (!window.ruleEditor) { 57 | console.log("window.ruleEditor not found."); 58 | window.ruleEditor = new RuleEditor(); 59 | } 60 | window.ruleEditor.initialize(request.rule, request.appliedRuleList); 61 | }; 62 | BackgroundCommunicator.prototype.execRuleSaveDoneSmartEditor = function (request) { 63 | window.smartRuleCreatorDialog.onSaveDone(request.rule); 64 | }; 65 | BackgroundCommunicator.prototype.execStop = function (request) { 66 | if (RuleExecutor.blockInterval) 67 | window.clearInterval(RuleExecutor.blockInterval); 68 | RuleExecutor.blockInterval = null; 69 | }; 70 | BackgroundCommunicator.prototype.execResume = function (request) { 71 | if (!RuleExecutor.blockInterval) 72 | RuleExecutor.blockInterval = window.setInterval(RuleExecutor.execBlock, 2000); 73 | }; 74 | BackgroundCommunicator.prototype.execReloadDelayed = function (request) { 75 | this.pendingRules = request.rules; 76 | if (!document.hidden) { 77 | this.execReload(); 78 | } 79 | }; 80 | BackgroundCommunicator.prototype.execReload = function () { 81 | if (this.pendingRules == null) { 82 | return; 83 | } 84 | rules = new Array(); 85 | RuleExecutor.checkRules(this.pendingRules); 86 | this.pendingRules = null; 87 | }; 88 | BackgroundCommunicator.prototype.onVisibilityChange = function (isHidden) { 89 | if (!isHidden) { 90 | this.execReload(); 91 | } 92 | }; 93 | BackgroundCommunicator.prototype.execQuickRuleCreation = function (request) { 94 | if (!window.smartRuleCreatorDialog) { 95 | window.smartRuleCreatorDialog = new SmartRuleCreatorDialog(RuleEditor.getMaxZIndex() + 1, request.src); 96 | } 97 | var creator = new SmartRuleCreator(lastRightClickedElement, request.appliedRuleList, request.selectionText, request.needSuggestion); 98 | }; 99 | BackgroundCommunicator.prototype.start = function () { 100 | var scope = this; 101 | chrome.runtime.onConnect.addListener(function (port) { 102 | scope.bgPort = port; 103 | port.onMessage.addListener(function (msg) { 104 | scope.processBackgroundRequest(msg, null, null); 105 | }); 106 | }); 107 | }; 108 | return BackgroundCommunicator; 109 | }()); 110 | chrome.extension.sendRequest({ command: "requestRules" }); 111 | if (!window.elementHighlighter) 112 | window.elementHighlighter = new ElementHighlighter(); 113 | if (!window.bgCommunicator) { 114 | window.bgCommunicator = new BackgroundCommunicator(); 115 | window.bgCommunicator.start(); 116 | } 117 | document.addEventListener('visibilitychange', function () { 118 | window.bgCommunicator.onVisibilityChange(document.hidden); 119 | }); 120 | chrome.extension.onRequest.addListener(function (request, sender, sendResponse) { 121 | console.warn("WARNING: Legacy request type."); 122 | console.warn(request); 123 | window.bgCommunicator.processBackgroundRequest(request, sender, sendResponse); 124 | }); 125 | var lastRightClickedElement = null; 126 | var lastRightClickEvent = null; 127 | document.body.oncontextmenu = function (event) { 128 | lastRightClickedElement = event.srcElement; 129 | lastRightClickEvent = event; 130 | }; 131 | var needExecBlock = true; 132 | document.body.addEventListener('DOMNodeInserted', function (event) { 133 | needExecBlock = true; 134 | }); 135 | //# sourceMappingURL=contentscript.js.map -------------------------------------------------------------------------------- /extension/src/css_builder.js: -------------------------------------------------------------------------------- 1 | var CssBuilder = (function () { 2 | function CssBuilder() { 3 | } 4 | CssBuilder.prototype.getIdExpression = function (elementId) { 5 | return '#' + elementId; 6 | }; 7 | CssBuilder.prototype.getDescendantSeparator = function () { 8 | return " "; 9 | }; 10 | CssBuilder.prototype.getChildSeparator = function () { 11 | return ">"; 12 | }; 13 | CssBuilder.prototype.getMultipleTagNameAndClassNameExpression = function (tagName, className) { 14 | return tagName + '.' + className; 15 | }; 16 | CssBuilder.prototype.getSingleTagNameAndClassNameExpression = function (tagName, className) { 17 | return tagName + '.' + className; 18 | }; 19 | CssBuilder.prototype.createPathFilter = function (_path) { 20 | var path = CustomBlockerUtil.trim(_path); 21 | return new CssPathFilter(path); 22 | }; 23 | return CssBuilder; 24 | }()); 25 | var CssPathFilter = (function () { 26 | function CssPathFilter(path) { 27 | this.path = path; 28 | this.elements = CustomBlockerUtil.getElementsByCssSelector(path); 29 | } 30 | return CssPathFilter; 31 | }()); 32 | //# sourceMappingURL=css_builder.js.map -------------------------------------------------------------------------------- /extension/src/db/DbInit.js: -------------------------------------------------------------------------------- 1 | var db = null; 2 | var needDbUpdate = false; 3 | var LATEST_DB_VERSION = "4.0"; 4 | var DB_SIZE = 1024 * 1024 * 5; 5 | try { 6 | needDbUpdate = false; 7 | db = window.openDatabase("customblocker", LATEST_DB_VERSION, "customblocker extension", DB_SIZE); 8 | } 9 | catch (ex) { 10 | console.log("Database Update Required." + ex); 11 | try { 12 | console.log("Trying to open DB 3.0"); 13 | db = window.openDatabase("customblocker", "2.0", "customblocker extension", DB_SIZE); 14 | if (db) { 15 | needDbUpdate = true; 16 | } 17 | } 18 | catch (ex) { 19 | console.log("Trying to open DB 3.0 ...Failed" + ex); 20 | try { 21 | console.log("Trying to open DB 2.0"); 22 | db = window.openDatabase("customblocker", "2.0", "customblocker extension", DB_SIZE); 23 | if (db) { 24 | needDbUpdate = true; 25 | } 26 | } 27 | catch (ex) { 28 | console.log("Trying to open DB 2.0 ...Failed" + ex); 29 | try { 30 | console.log("Trying to open DB 1.0"); 31 | db = window.openDatabase("customblocker", "1.0", "customblocker extension", DB_SIZE); 32 | if (db) { 33 | needDbUpdate = true; 34 | } 35 | } 36 | catch (ex) { 37 | console.log("Trying to open DB 1.0 ...Failed" + ex); 38 | } 39 | } 40 | } 41 | } 42 | function updateDbIfNeeded(callback) { 43 | console.log("updateDbIfNeeded needDbUpdate"); 44 | if (!db) { 45 | db = window.openDatabase("customblocker", "", "customblocker extension", DB_SIZE); 46 | } 47 | var currentDbVersion = db.version; 48 | if (LATEST_DB_VERSION != currentDbVersion) { 49 | console.log("Database Update " + currentDbVersion + "->" + LATEST_DB_VERSION); 50 | if ("3.0" == currentDbVersion) { 51 | console.log("Update from Default (1.0 or no-version)"); 52 | db.changeVersion(currentDbVersion, LATEST_DB_VERSION, function (transaction) { 53 | console.log("Adding columns..."); 54 | transaction.executeSql("alter table rule add column specify_url_by_regexp;"); 55 | transaction.executeSql("UPDATE rule SET specify_url_by_regexp=1;", [], function () { 56 | console.log("Columns added."); 57 | callback(); 58 | }, function () { 59 | console.log("DB Version-up FAILED. change version 2.0->1.0"); 60 | db.changeVersion("2.0", "1.0", callback); 61 | }); 62 | }); 63 | console.log("Update from ver 3.0"); 64 | } 65 | if ("2.0" == currentDbVersion) { 66 | console.log("Update from Default (1.0 or no-version)"); 67 | db.changeVersion(currentDbVersion, LATEST_DB_VERSION, function (transaction) { 68 | console.log("Adding columns..."); 69 | transaction.executeSql("alter table rule add column specify_url_by_regexp;"); 70 | transaction.executeSql("UPDATE rule SET specify_url_by_regexp=1;"); 71 | transaction.executeSql("alter table rule add column user_identifier;"); 72 | transaction.executeSql("alter table rule add column global_identifier;"); 73 | transaction.executeSql("alter table rule add column hide_block_css;", [], function () { 74 | console.log("Columns added."); 75 | callback(); 76 | }, function () { 77 | console.log("DB Version-up FAILED. change version 2.0->1.0"); 78 | db.changeVersion("2.0", "1.0", callback); 79 | }); 80 | }); 81 | console.log("Update from ver 2.0"); 82 | } 83 | else if ("1.0" == currentDbVersion || "" == currentDbVersion) { 84 | console.log("Update from Default (1.0 or no-version)"); 85 | db.changeVersion(currentDbVersion, LATEST_DB_VERSION, function (transaction) { 86 | console.log("Adding columns..."); 87 | transaction.executeSql("alter table rule add column specify_url_by_regexp;"); 88 | transaction.executeSql("UPDATE rule SET specify_url_by_regexp=1;"); 89 | transaction.executeSql("alter table rule add column user_identifier;"); 90 | transaction.executeSql("alter table rule add column global_identifier;"); 91 | transaction.executeSql("alter table rule add column search_block_by_css;"); 92 | transaction.executeSql("alter table rule add column search_block_css;"); 93 | transaction.executeSql("alter table rule add column hide_block_by_css;"); 94 | transaction.executeSql("alter table rule add column hide_block_css;", [], function () { 95 | console.log("Columns added."); 96 | callback(); 97 | }, function () { 98 | console.log("DB Version-up FAILED. change version 2.0->1.0"); 99 | db.changeVersion("2.0", "1.0", callback); 100 | }); 101 | }); 102 | } 103 | } 104 | else { 105 | console.log("updateDbIfNeeded() DB schema is up to date."); 106 | callback(); 107 | } 108 | } 109 | //# sourceMappingURL=DbInit.js.map -------------------------------------------------------------------------------- /extension/src/db/Word.js: -------------------------------------------------------------------------------- 1 | var __extends = (this && this.__extends) || (function () { 2 | var extendStatics = Object.setPrototypeOf || 3 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 4 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 5 | return function (d, b) { 6 | extendStatics(d, b); 7 | function __() { this.constructor = d; } 8 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 9 | }; 10 | })(); 11 | var LegacyWordPeer = (function (_super) { 12 | __extends(LegacyWordPeer, _super); 13 | function LegacyWordPeer() { 14 | var _this = _super.call(this) || this; 15 | _this.tableName = 'word'; 16 | _this.addColumn('word_id', DbColumn.TYPE_PKEY, 1.0, null); 17 | _this.addColumn('rule_id', DbColumn.TYPE_INTEGER, 1.0, null); 18 | _this.addColumn('word', DbColumn.TYPE_TEXT, 1.0, null); 19 | _this.addColumn('is_regexp', DbColumn.TYPE_BITFIELD, 1.0, ['is_regexp', 'is_complete_matching', 'is_case_sensitive', 'is_include_href']); 20 | _this.addColumn('insert_date', DbColumn.TYPE_TIMESTAMP, 1.0, null); 21 | _this.addColumn('update_date', DbColumn.TYPE_TIMESTAMP, 1.0, null); 22 | _this.addColumn('delete_date', DbColumn.TYPE_TIMESTAMP, 1.0, null); 23 | return _this; 24 | } 25 | LegacyWordPeer.getInstance = function () { 26 | if (!LegacyWordPeer.instance) { 27 | LegacyWordPeer.instance = new LegacyWordPeer(); 28 | } 29 | return LegacyWordPeer.instance; 30 | }; 31 | LegacyWordPeer.prototype.createObject = function () { 32 | return new LegacyWord(); 33 | }; 34 | return LegacyWordPeer; 35 | }(DbPeer)); 36 | var LegacyWord = (function (_super) { 37 | __extends(LegacyWord, _super); 38 | function LegacyWord() { 39 | return _super !== null && _super.apply(this, arguments) || this; 40 | } 41 | LegacyWord.prototype.getWord = function () { 42 | if (!this.newWord) { 43 | this.newWord = cbStorage.createWord(); 44 | this.newWord.word_id = this.word_id; 45 | this.newWord.rule_id = this.rule_id; 46 | this.newWord.word = this.word; 47 | this.newWord.is_regexp = this.is_regexp; 48 | this.newWord.is_complete_matching = this.is_complete_matching; 49 | this.newWord.is_case_sensitive = this.is_case_sensitive; 50 | this.newWord.is_include_href = this.is_include_href; 51 | } 52 | return this.newWord; 53 | }; 54 | return LegacyWord; 55 | }(DbObject)); 56 | //# sourceMappingURL=Word.js.map -------------------------------------------------------------------------------- /extension/src/index.js: -------------------------------------------------------------------------------- 1 | var Popup = (function () { 2 | function Popup() { 3 | this.prevHoverRule = null; 4 | } 5 | Popup.prototype.openRuleEditor = function () { 6 | this.removeHighlight(); 7 | var bgWindow = chrome.extension.getBackgroundPage(); 8 | bgWindow.openRulePicker(null); 9 | window.close(); 10 | }; 11 | Popup.prototype.highlightRuleElements = function (rule) { 12 | var bgWindow = chrome.extension.getBackgroundPage(); 13 | bgWindow.highlightRuleElements(rule); 14 | }; 15 | Popup.prototype.getAppliedRules = function () { 16 | try { 17 | CustomBlockerUtil.processPage(); 18 | } 19 | catch (ex) { 20 | document.write(ex); 21 | return; 22 | } 23 | this.refreshButton(); 24 | var bgWindow = chrome.extension.getBackgroundPage(); 25 | var scope = this; 26 | bgWindow.getAppliedRules(function (list) { 27 | try { 28 | scope.renderApplierRules(list); 29 | } 30 | catch (ex) { 31 | } 32 | }); 33 | }; 34 | Popup.prototype.setBlockOn = function (on) { 35 | localStorage.blockDisabled = (on) ? 'false' : 'true'; 36 | var bgWindow = chrome.extension.getBackgroundPage(); 37 | bgWindow.setIconDisabled(!on); 38 | this.refreshButton(); 39 | }; 40 | Popup.prototype.refreshButton = function () { 41 | var isDisabled = ('true' == localStorage.blockDisabled); 42 | document.getElementById('buttonOn').checked = !isDisabled; 43 | document.getElementById('buttonOff').checked = isDisabled; 44 | }; 45 | Popup.prototype.getLiMouseoverAction = function (rule) { 46 | var scope = this; 47 | return function () { 48 | if (scope.prevHoverRule == rule) 49 | return; 50 | scope.prevHoverRule = rule; 51 | scope.highlightRuleElements(rule); 52 | }; 53 | }; 54 | Popup.prototype.removeHighlight = function () { 55 | if (this.prevHoverRule != null) { 56 | this.prevHoverRule = null; 57 | var bgWindow = chrome.extension.getBackgroundPage(); 58 | bgWindow.highlightRuleElements(null); 59 | } 60 | }; 61 | Popup.prototype.renderApplierRules = function (list) { 62 | var ul = document.getElementById('activeRules'); 63 | var scope = this; 64 | ul.addEventListener('mouseout', function () { scope.removeHighlight(); }, false); 65 | if (list != null && list.length > 0) { 66 | for (var i = 0, l = list.length; i < l; i++) { 67 | var rule = list[i]; 68 | var li = document.createElement('LI'); 69 | var tip = CustomBlockerUtil.getRuleDetailTip(rule); 70 | if (tip) { 71 | li.title = tip; 72 | } 73 | li.addEventListener('mouseover', this.getLiMouseoverAction(rule), true); 74 | var divTitle = document.createElement('DIV'); 75 | divTitle.className = 'title'; 76 | divTitle.innerHTML = CustomBlockerUtil.shorten(rule.title, 42); 77 | var divCount = document.createElement('DIV'); 78 | divCount.className = 'count ' + ((rule.hiddenCount && rule.hiddenCount > 0) ? 'hit' : 'noHit'); 79 | divCount.innerHTML = (rule.hiddenCount) ? rule.hiddenCount.toString() : '0'; 80 | var buttonContainer = document.createElement('SPAN'); 81 | buttonContainer.className = 'button-container'; 82 | var editButton = document.createElement('INPUT'); 83 | editButton.type = 'BUTTON'; 84 | editButton.className = 'buttonEdit'; 85 | editButton.addEventListener('click', this.getEditRuleAction(rule), true); 86 | editButton.value = chrome.i18n.getMessage('buttonLabelEdit'); 87 | var disableButton = document.createElement('input'); 88 | disableButton.type = 'BUTTON'; 89 | disableButton.value = (rule.is_disabled) ? 'OFF' : 'ON'; 90 | disableButton.className = (rule.is_disabled) ? 'buttonOff' : 'buttonOn'; 91 | disableButton.addEventListener('click', this.getDisableAction(rule, disableButton), false); 92 | buttonContainer.appendChild(editButton); 93 | buttonContainer.appendChild(disableButton); 94 | li.appendChild(buttonContainer); 95 | li.appendChild(divCount); 96 | li.appendChild(divTitle); 97 | ul.appendChild(li); 98 | } 99 | } 100 | else { 101 | var emptyLi = document.createElement('LI'); 102 | emptyLi.className = 'empty'; 103 | emptyLi.innerHTML = 'None'; 104 | ul.appendChild(emptyLi); 105 | } 106 | }; 107 | Popup.prototype.getEditRuleAction = function (rule) { 108 | var scope = this; 109 | return function () { 110 | scope.removeHighlight(); 111 | var bgWindow = chrome.extension.getBackgroundPage(); 112 | bgWindow.openRulePicker(rule); 113 | window.close(); 114 | }; 115 | }; 116 | Popup.prototype.getDisableAction = function (rule, disableButton) { 117 | return function (event) { 118 | cbStorage.toggleRule(rule, function () { 119 | disableButton.value = (rule.is_disabled) ? 'OFF' : 'ON'; 120 | disableButton.className = (rule.is_disabled) ? 'buttonOff' : 'buttonOn'; 121 | }); 122 | }; 123 | }; 124 | return Popup; 125 | }()); 126 | window.onload = function () { 127 | var popup = new Popup(); 128 | popup.getAppliedRules(); 129 | document.getElementById('versionLabel').innerHTML = chrome.runtime.getManifest().version; 130 | document.getElementById('buttonOn').addEventListener('click', function () { popup.setBlockOn(true); }, false); 131 | document.getElementById('buttonOff').addEventListener('click', function () { popup.setBlockOn(false); }, false); 132 | document.getElementById('buttonOpenPreferenceTop').addEventListener('click', function openPreference() { window.open('pref/index.html?p=i1'); }, false); 133 | document.getElementById('buttonCreateRule').addEventListener('click', function () { popup.openRuleEditor(); }, false); 134 | }; 135 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /extension/src/path_analyzer.js: -------------------------------------------------------------------------------- 1 | var splitSpacesRegExp = new RegExp('[ \\n]+', 'g'); 2 | var PathElement = (function () { 3 | function PathElement(node, index, builder) { 4 | this.node = node; 5 | this.builder = builder; 6 | this.isTarget = false; 7 | this.parentNode = null; 8 | this.upperKeyNode = null; 9 | this.classes = (null == node.className || '' == node.className) ? new Array() : node.className.replace(splitSpacesRegExp, ' ').split(' '); 10 | var tagName = this.node.tagName; 11 | this.options = new Array(); 12 | if ((this.classes.length > 1 || index == 0) && 'BODY' != tagName) { 13 | for (var i = 0, l = this.classes.length; i < l; i++) { 14 | if (this.classes[i] == '') 15 | continue; 16 | var xpath = this.builder.getMultipleTagNameAndClassNameExpression(tagName, this.classes[i]); 17 | this.options.push(xpath); 18 | } 19 | } 20 | else if (this.classes.length == 1 && 'BODY' != tagName) { 21 | var className = this.classes[0]; 22 | this.options.push(this.builder.getSingleTagNameAndClassNameExpression(this.node.tagName, className)); 23 | } 24 | if ('DIV' != tagName && 'UL' != tagName) 25 | this.options.push(this.node.tagName); 26 | } 27 | return PathElement; 28 | }()); 29 | var PathAnalyzer = (function () { 30 | function PathAnalyzer(targetNode, builder, rootNode, basePath) { 31 | this.builder = builder; 32 | this.targetNode = targetNode; 33 | this.rootNode = rootNode || document.body; 34 | this.basePath = basePath || ''; 35 | this.pathList = null; 36 | this.ancestors = []; 37 | } 38 | PathAnalyzer.prototype.createPathList = function () { 39 | { 40 | var node = this.targetNode; 41 | var index = 0; 42 | while (node) { 43 | if (this.rootNode == node) 44 | break; 45 | var element_1 = new PathElement(node, index, this.builder); 46 | this.ancestors.push(element_1); 47 | node = node.parentNode; 48 | index++; 49 | } 50 | } 51 | for (var i = 0, l = this.ancestors.length; i < l; i++) { 52 | var childNode = (i > 0) ? this.ancestors[i - 1] : null; 53 | var node = this.ancestors[i]; 54 | node.isTarget = (0 == i); 55 | } 56 | this.seqList = []; 57 | this.pathList = []; 58 | this.uniqPathList = []; 59 | if (this.ancestors.length > 0) 60 | this.scan(0, new Array()); 61 | if (this.basePath.length > 0) { 62 | this.pathList.push(this.builder.createPathFilter(this.basePath)); 63 | } 64 | for (var i = 0, l = this.uniqPathList.length; i < l; i++) { 65 | try { 66 | var path_1 = this.builder.createPathFilter(this.basePath + this.uniqPathList[i]); 67 | var nested = false; 68 | for (var elementIndex = 0; elementIndex < path_1.elements.length; elementIndex++) { 69 | var element = path_1.elements[elementIndex]; 70 | if (element != this.targetNode && 71 | (CustomBlockerUtil.isContained(this.targetNode, element) || CustomBlockerUtil.isContained(element, this.targetNode))) { 72 | nested = true; 73 | } 74 | } 75 | if (!nested) 76 | this.pathList.push(path_1); 77 | } 78 | catch (ex) { 79 | console.log(ex); 80 | } 81 | } 82 | this.pathList.sort(function (a, b) { 83 | return (a.elements.length == b.elements.length) ? 84 | (a.path.length - b.path.length) : (a.elements.length - b.elements.length); 85 | }); 86 | var list = []; 87 | var prevPath = null; 88 | for (var i = 0, l = this.pathList.length; i < l; i++) { 89 | var path = this.pathList[i]; 90 | if (!prevPath || prevPath.elements.length != path.elements.length) { 91 | list.push(path); 92 | } 93 | prevPath = path; 94 | } 95 | return list; 96 | }; 97 | PathAnalyzer.prototype.scan = function (index, seq) { 98 | var current = this.ancestors[index]; 99 | for (var i = 0, l = current.options.length; i < l; i++) { 100 | var cloneSeq = PathAnalyzer.cloneArray(seq); 101 | var option = current.options[i]; 102 | cloneSeq.push({ path: option, index: index }); 103 | if (cloneSeq.length < PathAnalyzer.SEQ_LIMIT && this.ancestors.length > index + 1) 104 | this.scan(index + 1, PathAnalyzer.cloneArray(PathAnalyzer.cloneArray(cloneSeq))); 105 | this.addSeq(cloneSeq); 106 | } 107 | if (index > 0 && seq.length < PathAnalyzer.SEQ_LIMIT && this.ancestors.length > index + 1) 108 | this.scan(index + 1, PathAnalyzer.cloneArray(seq)); 109 | if (this.rootNode == document.body && current.node.id) { 110 | var cloneSeq = PathAnalyzer.cloneArray(seq); 111 | cloneSeq.push({ path: this.builder.getIdExpression(current.node.id), index: index, hasId: true }); 112 | this.addSeq(cloneSeq); 113 | } 114 | }; 115 | PathAnalyzer.prototype.addSeq = function (seq) { 116 | var str = ''; 117 | for (var i = 0, l = seq.length; i < l; i++) { 118 | var next = (i < l - 1) ? seq[i + 1] : null; 119 | var current = seq[i]; 120 | str = current.path + str; 121 | if (current.hasId) { 122 | } 123 | else if ((next && next.index == current.index + 1) || 'BODY' == current.path) 124 | str = this.builder.getChildSeparator() + str; 125 | else 126 | str = this.builder.getDescendantSeparator() + str; 127 | } 128 | if (!CustomBlockerUtil.arrayContains(this.uniqPathList, str)) 129 | this.uniqPathList.push(str); 130 | }; 131 | PathAnalyzer.cloneArray = function (orig) { 132 | var array = new Array(); 133 | for (var i = 0, l = orig.length; i < l; i++) { 134 | array[i] = { path: orig[i].path, index: orig[i].index }; 135 | } 136 | return array; 137 | }; 138 | PathAnalyzer.initialize = function () { 139 | PathAnalyzer.SEQ_LIMIT = 2; 140 | }; 141 | return PathAnalyzer; 142 | }()); 143 | //# sourceMappingURL=path_analyzer.js.map -------------------------------------------------------------------------------- /extension/src/pref/export.js: -------------------------------------------------------------------------------- 1 | var Export = (function () { 2 | function Export() { 3 | } 4 | Export.onStart = function () { 5 | Export.ruleWrapperList = new Array(); 6 | Export.loadLists(); 7 | document.getElementById('help_link').setAttribute("href", 'help_' + chrome.i18n.getMessage('extLocale') + '.html'); 8 | document.getElementById('donate_link').setAttribute("href", 'help_' + chrome.i18n.getMessage('extLocale') + '.html#donate'); 9 | document.getElementById('checkboxToggleAll').addEventListener('change', Export.toggleAllCheckboxes, null); 10 | document.getElementById('buttonExportSelected').addEventListener('click', Export.exportSelected, null); 11 | CustomBlockerUtil.processPage(); 12 | }; 13 | Export.exportSelected = function () { 14 | var ruleList = new Array(); 15 | for (var i = 0, l = Export.ruleWrapperList.length; i < l; i++) { 16 | var ruleWrapper = Export.ruleWrapperList[i]; 17 | if (ruleWrapper.checkbox.checked) { 18 | ruleList.push(ruleWrapper.rule); 19 | } 20 | } 21 | if (ruleList.length < 1) { 22 | alert(chrome.i18n.getMessage('errorExportNoRule')); 23 | return; 24 | } 25 | console.log(JSON.stringify(ruleList)); 26 | var url = "data:application/octet-stream," + encodeURIComponent(JSON.stringify(ruleList)); 27 | window.open(url); 28 | }; 29 | Export.toggleAllCheckboxes = function () { 30 | PrefRuleWrapper.toggleAllCheckboxes(document.getElementById('checkboxToggleAll'), Export.ruleWrapperList); 31 | }; 32 | Export.loadLists = function () { 33 | CustomBlockerStorage.getInstance().loadAll(function (rules) { 34 | Export.ruleList = rules; 35 | for (var i = 0; i < Export.ruleList.length; i++) { 36 | var rule = Export.ruleList[i]; 37 | var wrapper = new PrefRuleWrapper(rule); 38 | Export.ruleWrapperList.push(wrapper); 39 | document.getElementById('ruleList').appendChild(wrapper.liElement); 40 | } 41 | }); 42 | }; 43 | return Export; 44 | }()); 45 | PrefRuleWrapper.getSubDivClassName = function () { 46 | return "sub_export"; 47 | }; 48 | window.onload = Export.onStart; 49 | //# sourceMappingURL=export.js.map -------------------------------------------------------------------------------- /extension/src/pref/help.js: -------------------------------------------------------------------------------- 1 | window.onload = function () { 2 | CustomBlockerUtil.processPage(); 3 | }; 4 | //# sourceMappingURL=help.js.map -------------------------------------------------------------------------------- /extension/src/pref/import_export.js: -------------------------------------------------------------------------------- 1 | var PrefRuleWrapper = (function () { 2 | function PrefRuleWrapper(rule) { 3 | this.rule = rule; 4 | this.liElement = document.createElement('LI'); 5 | this.subLiElement = document.createElement('DIV'); 6 | this.subLiElement.className = PrefRuleWrapper.getSubDivClassName(); 7 | this.checkbox = document.createElement('INPUT'); 8 | this.checkbox.type = 'checkbox'; 9 | this.checkbox.className = 'check'; 10 | this.liElement.addEventListener('click', function (event) { 11 | if (checkbox == event.srcElement) 12 | return; 13 | checkbox.checked = !checkbox.checked; 14 | }, true); 15 | var checkbox = this.checkbox; 16 | this.liElement.appendChild(this.checkbox); 17 | var informationDiv = document.createElement('DIV'); 18 | informationDiv.className = 'information'; 19 | this.subLiElement.appendChild(informationDiv); 20 | var titleDiv = document.createElement('DIV'); 21 | titleDiv.className = 'title'; 22 | var title = this.rule.title; 23 | titleDiv.innerHTML = CustomBlockerUtil.shorten(title, 42); 24 | var urlDiv = document.createElement('DIV'); 25 | urlDiv.className = 'url'; 26 | urlDiv.innerHTML = CustomBlockerUtil.shorten(this.rule.site_regexp, 36); 27 | var keywordsDiv = document.createElement('DIV'); 28 | keywordsDiv.className = 'keywords'; 29 | var keywords = new Array(); 30 | for (var i = 0, l = this.rule.words.length; i < l; i++) { 31 | var keywordSpan = document.createElement('SPAN'); 32 | keywordSpan.className = (this.rule.words[i].is_regexp) ? "keyword regex" : "keyword normal"; 33 | keywordSpan.innerHTML = this.rule.words[i].word; 34 | keywordsDiv.appendChild(keywordSpan); 35 | } 36 | informationDiv.appendChild(titleDiv); 37 | informationDiv.appendChild(urlDiv); 38 | informationDiv.appendChild(keywordsDiv); 39 | var exampleLink = document.createElement('A'); 40 | exampleLink.className = 'exampleUrl'; 41 | exampleLink.innerHTML = '[LINK]'; 42 | exampleLink.setAttribute("target", '_blank'); 43 | exampleLink.setAttribute("href", this.rule.example_url); 44 | var favicon = document.createElement('IMG'); 45 | var faviconSrc = (this.rule.example_url) ? 46 | 'chrome://favicon/' + rule.example_url : chrome.extension.getURL('img/world.png'); 47 | favicon.className = 'favicon'; 48 | favicon.setAttribute("src", faviconSrc); 49 | informationDiv.appendChild(favicon); 50 | this.liElement.appendChild(this.subLiElement); 51 | informationDiv.appendChild(exampleLink); 52 | } 53 | PrefRuleWrapper.toggleAllCheckboxes = function (sender, wrapperList) { 54 | var checked = sender.checked; 55 | for (var i = 0, l = wrapperList.length; i < l; i++) { 56 | wrapperList[i].checkbox.checked = checked; 57 | } 58 | }; 59 | PrefRuleWrapper.setSubDivClassName = function (name) { 60 | PrefRuleWrapper.subDivClassName = name; 61 | }; 62 | PrefRuleWrapper.getSubDivClassName = function () { 63 | return PrefRuleWrapper.subDivClassName; 64 | }; 65 | return PrefRuleWrapper; 66 | }()); 67 | //# sourceMappingURL=import_export.js.map -------------------------------------------------------------------------------- /extension/src/smart_path_analyzer.js: -------------------------------------------------------------------------------- 1 | var SmartPathAnalyzer = (function () { 2 | function SmartPathAnalyzer(_node, builder, appliedRuleList) { 3 | this._node = _node; 4 | this.builder = builder; 5 | this.appliedRuleList = appliedRuleList; 6 | } 7 | SmartPathAnalyzer.prototype.createPathList = function () { 8 | this.addedHidePaths = []; 9 | this.addedSearchPaths = []; 10 | var hideOriginalNode = this._node; 11 | var pathList = []; 12 | while (hideOriginalNode) { 13 | var siblings = CustomBlockerUtil.getSimilarSiblings(hideOriginalNode); 14 | if (siblings.length > 0) { 15 | this.analyzerHideNode(hideOriginalNode, this._node, pathList); 16 | } 17 | hideOriginalNode = hideOriginalNode.parentNode; 18 | } 19 | return pathList; 20 | }; 21 | SmartPathAnalyzer.prototype.analyzerHideNode = function (hideOriginalNode, originalNode, pathList) { 22 | var hidePathSelectors = new PathAnalyzer(hideOriginalNode, this.builder, null, null).createPathList(); 23 | for (var i = hidePathSelectors.length - 1; i >= 0; i--) { 24 | var hidePathSelector = hidePathSelectors[i]; 25 | if (CustomBlockerUtil.arrayContains(this.addedHidePaths, hidePathSelector.path)) { 26 | continue; 27 | } 28 | this.addedHidePaths.push(hidePathSelector.path); 29 | var hideElements = hidePathSelector.elements; 30 | var siblingFound = false; 31 | for (var hideIndex = 0; hideIndex < hideElements.length; hideIndex++) { 32 | if (hideElements[hideIndex] != hideOriginalNode && hideElements[hideIndex].parentNode == hideOriginalNode.parentNode) { 33 | siblingFound = true; 34 | } 35 | } 36 | if (hideElements.length > 1 && siblingFound) { 37 | var searchOriginalNode = originalNode; 38 | while (CustomBlockerUtil.isContained(searchOriginalNode, hideOriginalNode)) { 39 | var searchPathSelectors = new PathAnalyzer(searchOriginalNode, this.builder, hideOriginalNode, hidePathSelector.path).createPathList(); 40 | for (var searchIndex = 0; searchIndex < searchPathSelectors.length; searchIndex++) { 41 | var searchPathSelector = searchPathSelectors[searchIndex]; 42 | if (CustomBlockerUtil.arrayContains(this.addedSearchPaths, searchPathSelector.path)) { 43 | continue; 44 | } 45 | if (this.isIncludedInAppliedRules(hidePathSelector, searchPathSelector)) { 46 | continue; 47 | } 48 | this.addedSearchPaths.push(searchPathSelector.path); 49 | var searchSelectedNodes = searchPathSelector.elements; 50 | var searchElements = searchPathSelector.elements; 51 | var containedNode = CustomBlockerUtil.getContainedElements(hideElements, searchElements); 52 | if (containedNode.length > 1) { 53 | pathList.push(new SmartPath(hidePathSelector, searchPathSelector)); 54 | } 55 | } 56 | searchOriginalNode = searchOriginalNode.parentNode; 57 | } 58 | } 59 | } 60 | }; 61 | SmartPathAnalyzer.prototype.isIncludedInAppliedRules = function (hidePathSelector, searchPathSelector) { 62 | if (!this.appliedRuleList) { 63 | return false; 64 | } 65 | for (var _i = 0, _a = this.appliedRuleList; _i < _a.length; _i++) { 66 | var rule = _a[_i]; 67 | if (CustomBlockerUtil.arrayEquals(hidePathSelector.elements, rule.hideNodes) && 68 | CustomBlockerUtil.arrayEquals(searchPathSelector.elements, rule.searchNodes)) { 69 | return true; 70 | } 71 | } 72 | return false; 73 | }; 74 | return SmartPathAnalyzer; 75 | }()); 76 | var pathCount = 0; 77 | var SmartPath = (function () { 78 | function SmartPath(hidePath, searchPath) { 79 | this.hidePath = hidePath; 80 | this.searchPath = searchPath; 81 | } 82 | return SmartPath; 83 | }()); 84 | //# sourceMappingURL=smart_path_analyzer.js.map -------------------------------------------------------------------------------- /extension/src/uuid.js: -------------------------------------------------------------------------------- 1 | function UUID() { } 2 | UUID.generate = function () { 3 | var rand = UUID._gri, hex = UUID._ha; 4 | return hex(rand(32), 8) 5 | + "-" 6 | + hex(rand(16), 4) 7 | + "-" 8 | + hex(0x4000 | rand(12), 4) 9 | + "-" 10 | + hex(0x8000 | rand(14), 4) 11 | + "-" 12 | + hex(rand(48), 12); 13 | }; 14 | UUID._gri = function (x) { 15 | if (x < 0) 16 | return NaN; 17 | if (x <= 30) 18 | return (0 | Math.random() * (1 << x)); 19 | if (x <= 53) 20 | return (0 | Math.random() * (1 << 30)) 21 | + (0 | Math.random() * (1 << x - 30)) * (1 << 30); 22 | return NaN; 23 | }; 24 | UUID._ha = function (num, length) { 25 | var str = num.toString(16), i = length - str.length, z = "0"; 26 | for (; i > 0; i >>>= 1, z += z) { 27 | if (i & 1) { 28 | str = z + str; 29 | } 30 | } 31 | return str; 32 | }; 33 | //# sourceMappingURL=uuid.js.map -------------------------------------------------------------------------------- /extension/src/xpath_builder.js: -------------------------------------------------------------------------------- 1 | var XpathBuilder = (function () { 2 | function XpathBuilder() { 3 | } 4 | XpathBuilder.prototype.getIdExpression = function (elementId) { 5 | return 'id("' + elementId + '")'; 6 | }; 7 | XpathBuilder.prototype.getDescendantSeparator = function () { 8 | return "//"; 9 | }; 10 | XpathBuilder.prototype.getChildSeparator = function () { 11 | return "/"; 12 | }; 13 | XpathBuilder.prototype.getMultipleTagNameAndClassNameExpression = function (tagName, className) { 14 | return tagName 15 | + '[contains(concat(" ",normalize-space(@class)," "),"' 16 | + className 17 | + '")]'; 18 | }; 19 | XpathBuilder.prototype.getSingleTagNameAndClassNameExpression = function (tagName, className) { 20 | return tagName + '[@class="' + className + '"]'; 21 | }; 22 | XpathBuilder.prototype.createPathFilter = function (_path) { 23 | var path = CustomBlockerUtil.trim(_path); 24 | return new XpathPathFilter(path); 25 | }; 26 | return XpathBuilder; 27 | }()); 28 | var XpathPathFilter = (function () { 29 | function XpathPathFilter(path) { 30 | this.path = path; 31 | this.elements = CustomBlockerUtil.getElementsByXPath(path); 32 | } 33 | return XpathPathFilter; 34 | }()); 35 | //# sourceMappingURL=xpath_builder.js.map -------------------------------------------------------------------------------- /extension/welcome_en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome | CustomBlocker 6 | 7 | 8 | 9 | 10 | 11 |