diff --git a/css/help.css b/css/help.css index e104f93..f98a95b 100644 --- a/css/help.css +++ b/css/help.css @@ -1,106 +1,123 @@ body { - font-family:Arial, sans-serif; - font-size:16px; - line-height: 20px; - max-width:740px; - margin:20px auto; - border:solid 1px #bbb; - padding:50px; - background: white; - border-radius: 4px; - color: #2b2626; + font-family: Arial, sans-serif; + font-size: 1rem; + line-height: 20px; + width: auto; + border: solid 1px #bbb; + background: white; + border-radius: 4px; + color: #2b2626; } -a, a:visited { - color:rgb(21,90,233); - text-decoration: none; +a, +a:visited { + color: rgb(21, 90, 233); + text-decoration: none; } a:hover { - color:black; - text-decoration: underline; + color: black; + text-decoration: underline; } html { - background: #f8f8f8; + background: #f8f8f8; } h1 { - text-align: center; - font-size:38px; - margin-bottom:80px; + font-size: 3rem; + line-height: 3rem; + margin-bottom: 80px; + letter-spacing: 2.1px; +} + +h3{ + font-size: 1.5rem; + line-height: 3rem; } h4 { - font-size:24px; - margin-bottom:0px; - padding-bottom:0px; + font-size: 1.2rem; + margin-bottom: 0px; + padding-bottom: 0px; } li { - margin:2px; + margin: 2px; } .fields li { - margin:10px 4px; + margin: 10px 4px; } .url { - font-style: italic; + font-style: italic; } td.pattern { - font-weight: normal; - background:transparent; + font-weight: normal; + background: transparent; } th { - text-align:right; + text-align: right; } table { - margin:10px; - border:solid 1px #bbb; - padding:8px; - margin-bottom:30px; - border-radius: 3px; + margin: 10px; + border: solid 1px #bbb; + padding: 8px; + margin-bottom: 30px; + border-radius: 3px; } .pattern { - color:black; - font-weight: bold; - display: inline-block; - padding-left:2px; - padding-right:2px; - border-radius:3px; - background: #eee; + color: black; + font-weight: bold; + display: inline-block; + padding-left: 2px; + padding-right: 2px; + border-radius: 3px; + background: #eee; } /* Dark mode support */ @media (prefers-color-scheme: dark) { - - html { - background: rgb(32,33,36); - } - body { - background: rgb(42,43,46); - color: #ddd; - border: solid 1px #888; - } - th { - color: white; - font-weight: normal; - } - a, a:visited, a:hover { - color: rgb(138,179,241); - } - - h1, h2, h3, h4, strong { - color: white; - } - - tr .pattern { - color: rgb(53,180,75); - } - } \ No newline at end of file + html { + background: rgb(32, 33, 36); + } + body { + background: rgb(42, 43, 46); + color: #ddd; + border: solid 1px #888; + } + th { + color: white; + font-weight: normal; + } + a, + a:visited, + a:hover { + color: rgb(138, 179, 241); + } + + h1, + h2, + h3, + h4 { + text-align: center; + } + + h1, + h2, + h3, + h4, + strong { + color: white; + } + + tr .pattern { + color: rgb(53, 180, 75); + } +} diff --git a/css/popup.css b/css/popup.css index 573d18f..26834d9 100644 --- a/css/popup.css +++ b/css/popup.css @@ -1,88 +1,89 @@ - body { - width: 180px; - text-align: center; - font-family: Arial, sans-serif; + width: auto; + text-align: center; + font-family: Arial, sans-serif; } h1 { - margin-top: 4px; - font-size: 22px; - font-weight: bold; - letter-spacing: 1.5px; + margin-top: 4px; + font-size: 3rem; + font-weight: bold; + letter-spacing: 2.1px; } h1 span { - position: relative; - top: 1px; - font-size: 38px; + position: relative; + top: 1px; + font-size: 38px; } button { - margin: 5px auto !important; - display: block; - width: 90%; + margin: 5px auto !important; + font-size: 1.4rem; + display: block; + width: 90%; + min-height: 32px; + line-height: 29px; } .disabled { - margin-top: -16px; - height: 13px; - color: red; - font-size: 12px; + margin-top: -1.5rem; + color: red; + font-size: 2.5rem; + letter-spacing: 2.1px; } label { - margin: 6px auto; - display: block; - width: 85%; - text-align: left; - font-size: 12px !important; + margin: 6px auto; + display: block; + width: 85%; + text-align: left; + font-size: 12px !important; } /* Firefox only */ -@supports (-moz-appearance:none) { - label input { - position: relative; - top: 1px; - } +@supports (-moz-appearance: none) { + label input { + position: relative; + top: 1px; + } } button { - height: 20px; - border: solid 1px #aaa !important; - border-radius: 3px; - color: #333; + height: 20px; + border: solid 1px #aaa !important; + border-radius: 3px; + color: #333; } label span { - position: relative; - top: 1px; + position: relative; + top: 1px; } @media (prefers-color-scheme: dark) { + html { + background: rgb(52, 53, 56); + color: #ddd; + } - html { - background: rgb(52,53,56); - color: #ddd; - } - - h1, - label { - color: #eee; - } + h1, + label { + color: #eee; + } - th { - color: #eee; - font-weight: normal; - } + th { + color: #eee; + font-weight: normal; + } - .disabled span { - color: rgb(240,85,82); - } + .disabled span { + color: rgb(240, 85, 82); + } - button { - border: solid 1px #777 !important; - background-color: rgb(32,33,36) !important; - color: #ddd; - } -} + button { + border: solid 1px #777 !important; + background-color: rgb(32, 33, 36) !important; + color: #ddd; + } +} \ No newline at end of file diff --git a/css/redirector.css b/css/redirector.css index 63ee0a7..51bdca5 100644 --- a/css/redirector.css +++ b/css/redirector.css @@ -1,122 +1,124 @@ - /* Basic element styles */ body { font-family: Arial, sans-serif; - font-size:14px; - background:white; - color:rgb(43, 38, 38); + font-size: 14px; + background: white; + color: rgb(43, 38, 38); } -h1, h2, h3, h5, h6 { +h1, +h2, +h3, +h5, +h6 { text-align: center; } h1 { - font-size:55px; - margin-bottom:0px; - cursor:default; - padding:0px; + font-size: 3rem; + margin-bottom: 0px; + cursor: default; + padding: 0px; letter-spacing: 2.1px; } h3 { - font-size:18px; - padding:0px; + font-size: 1.5rem; + padding: 0px; } h4 { text-align: left; - font-size:14px; - padding:0px; - margin:4px; + font-size: 1.2rem; + padding: 0px; + margin: 4px; } h5 { - font-size:20px; - margin:-6px 0 0 0; - color:#5e6163; + font-size: 1.1rem; + margin: -6px 0 0 0; + color: #5e6163; } -input[type='text'] { - border-radius:2px; - padding:3px; - border:solid 1px #bbb; +input[type="text"] { + border-radius: 2px; + padding: 3px; + border: solid 1px #bbb; } input[type="radio"] { - margin-right:5px; + margin-right: 5px; } /* Classes for buttons and other stuff */ .btn { - background:white; - border:solid 1px #bbb; - border-radius:3px; + background: white; + border: solid 1px #bbb; + border-radius: 3px; cursor: pointer; font-weight: bold; - display:inline-block; + display: inline-block; text-align: center; text-decoration: none; + text-shadow: none; } .btn.large { - font-size:18px; - padding:4px 8px; - + font-size: 18px; + padding: 4px 8px; } .btn.medium { - font-size:14px; - padding:2px 6px; + font-size: 14px; + padding: 2px 6px; } .btn:hover { - color:white !important; + color: white !important; text-decoration: none; } - .btn.grey { - color:#333; + color: #333; } .btn.grey:hover { - background:#333; - border:solid 1px #333; + background: #333; + border: solid 1px #333; } .btn.red { - color:rgb(208,52,37); + color: rgb(208, 52, 37); } .btn.red:hover { - background:rgb(208,52,37); - border:solid 1px rgb(208,52,37); + background: rgb(208, 52, 37); + border: solid 1px rgb(208, 52, 37); } .btn.blue { - color:rgb(21,90,233); + color: rgb(21, 90, 233); } .btn.blue:hover { - background:rgb(21,90,233); - border:solid 1px rgb(21,90,233); + background: rgb(21, 90, 233); + border: solid 1px rgb(21, 90, 233); } .btn.green { - color:green; + color: green; } .btn.green:hover { - background:green; - border:solid 1px green; + background: green; + border: solid 1px green; } .btn.blue.active { color: white; - background:rgb(21,90,233); + background: rgb(21, 90, 233); } #redirect-row-template { @@ -126,33 +128,34 @@ input[type="radio"] { /* Main menu with buttons */ #menu { - margin: 30px auto 8px auto; - max-width:90%; + margin: 30px auto; + max-width: 90%; text-align: center; } #import-file { - display:none; + display: none; } /* Message box for success/failure messages */ #message-box { - margin:10px auto; - width:90%; - color:white; + margin: 10px auto; + width: 100%; + color: white; max-width: 800px; - border-radius:3px; - height:0px; - line-height: 30px; - font-size:16px; - text-align:center; - overflow:hidden; + border-radius: 3px; + height: 0px; + line-height: 2rem; + font-size: 1rem; + text-align: center; + overflow: hidden; + white-space: normal; transition: height 0.2s ease-out; position: relative; } #message-box.visible { - height:30px; + height: auto; transition: height 0.2s ease-out; } @@ -161,53 +164,54 @@ input[type="radio"] { } #message-box.error { - background-color: rgb(208,52,37);; + background-color: rgb(208, 52, 37); } #message-box a { - color:white; - font-size:20px; + color: white; + font-size: 1.5rem; position: absolute; - right:6px; - top:0px; - cursor:pointer; + right: 6px; + top: 50%; + transform: translateY(-50%); + cursor: pointer; } /* Table of redirects */ .redirect-table { - max-width:800px; - border:solid 1px #bbb; - margin:0px auto; - border-radius:3px; + max-width: 800px; + border: solid 1px #bbb; + margin: 0px auto; + border-radius: 3px; } .redirect-row { position: relative; - font-size:14px; - padding:8px; - line-height:18px; - border-bottom:solid 1px #bbb; + font-size: 14px; + padding: 8px; + line-height: 18px; + border-bottom: solid 1px #bbb; } .redirect-info { - display:table; + display: table; } .redirect-info div { - display:table-row; + display: table-row; } .redirect-info div label { - display:table-cell; - padding:3px 5px; + display: table-cell; + padding: 3px 5px; white-space: nowrap; } .redirect-info div p { - display:table-cell; - word-wrap:anywhere; - max-width:700px; + display: table-cell; + word-wrap: anywhere; + max-width: 700px; } .redirect-row:last-child { @@ -215,55 +219,65 @@ input[type="radio"] { } .redirect-row:nth-child(odd) { - background:#f8f8f8; + background: #f8f8f8; } -.redirect-info.disabled label, .redirect-info.disabled span, span.disabled, .redirect-info.disabled p, a.disabled, button[disabled] { - color:#bbb !important; +.redirect-info.disabled label, +.redirect-info.disabled span, +span.disabled, +.redirect-info.disabled p, +a.disabled, +button[disabled] { + color: #bbb !important; } button span { - pointer-events:none; + pointer-events: none; } /* Edit, Delete, Disable buttons */ .redirect-row button { - font-size:13px; - margin-top:5px; - padding:2px; - width:80px; + font-size: 13px; + margin-top: 5px; + padding: 2px; + width: 80px; display: inline-block; } .redirect-row h4 span.disabled-marker { - color:red !important; + color: red !important; } /* nav btns */ -.move-up-btn, .move-down-btn, .move-downbottom-btn, .move-uptop-btn { - width:45px !important; +.move-up-btn, +.move-down-btn, +.move-downbottom-btn, +.move-uptop-btn { + width: 45px !important; } -.move-downbottom-btn, .move-uptop-btn { - height:25px !important; +.move-downbottom-btn, +.move-uptop-btn { + height: 25px !important; } .redirect-row label { - display:inline-block; - width:80px; - font-weight:bold; + display: inline-block; + width: 80px; + font-weight: bold; text-align: right; } .arrow { - font-size:18px; + font-size: 18px; } -a.disabled:hover, button[disabled]:hover { - cursor:default; - color:#bbb !important; - border:solid 1px #bbb !important; - background:white !important; +a.disabled:hover, +button[disabled]:hover { + cursor: default; + color: #bbb !important; + border: solid 1px #bbb !important; + background: white !important; } /* Toggle Grouping Checkbox */ @@ -300,7 +314,7 @@ a.disabled:hover, button[disabled]:hover { } .toggle-container input:checked ~ .checkMarked { - background-color: #2196F3; + background-color: #2196f3; } .checkmark:after { @@ -329,49 +343,45 @@ a.disabled:hover, button[disabled]:hover { #delete-redirect-form { position: fixed; - padding:10px; - width:500px; - background:white; - border:solid 1px #bbb; - border-radius:3px; + padding: 10px; + width: 45%; + background: white; + border: solid 1px #bbb; + border-radius: 3px; z-index: 6000; - left:50%; - margin-left:-260px; - top:50%; - margin-top:-220px; - height:255px; - display:none; + left: 50%; + top: 50%; + display: none; + transform: translate(-50%, -50%); } #delete-redirect-form div{ - margin-bottom:7px; + margin-bottom: 7px; } #delete-redirect-form div label:first-child { - width:130px; - font-weight:bold; + font-weight: bold; text-align: right; - display:inline-block; + display: inline-block; vertical-align: top; } #delete-redirect-form div span { - display:inline-block; - width: 330px; + display: inline-block; + width: 70%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; - vertical-align: top; } /* Edit form */ #cover { position: fixed; - top:0px; - bottom:0px; - left:0px; - right:0px; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; z-index: 5000; background: #333; opacity: 0.5; @@ -379,116 +389,115 @@ a.disabled:hover, button[disabled]:hover { } .blur { - -webkit-filter:blur(3px); - filter:blur(3px); + -webkit-filter: blur(3px); + filter: blur(3px); } #edit-redirect-form { position: fixed; - display:table; - display:none; - width:700px; - background:white; - border:solid 1px #bbb; - border-radius:3px; + padding: 10px; + background: white; + border: solid 1px #bbb; + border-radius: 3px; z-index: 6000; - left:50%; - margin-left:-350px; - top:50%; - transform: translateY(-50%); - max-height: 96vh; + display: none; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); overflow: auto; } .form-grid { - display:table; + display: table; } -.form-grid > div{ - display:table-row; +.form-grid > div { + display: table-row; } .form-grid > div > label { - display:table-cell; - font-weight:bold; + display: table-cell; + font-weight: bold; text-align: right; - padding:6px; + padding: 6px; white-space: nowrap; - width:140px; - vertical-align:top; + width: 140px; + vertical-align: top; } .input-cell { - padding-top:1px; + padding-top: 1px; } -.form-grid div input[type='text'] { - width:510px; - font-size:14px; +.form-grid div input[type="text"] { + width: 510px; + font-size: 0.9rem; } .example-result { - width:500px; - display:inline-block; - word-wrap:break-word; - margin-top:5px; + width: 500px; + display: inline-block; + word-wrap: break-word; + margin-top: 5px; } .example-result-error { - margin-top:5px; - display:inline-block; + margin-top: 5px; + display: inline-block; } -#unescape-matches, #escape-matches { - margin-top:7px; - margin-left:0px; +#unescape-matches, +#escape-matches { + margin-top: 7px; + margin-left: 0px; } .input-cell label { - display:block; + display: block; } #apply-to { - padding-top:3px; + padding-top: 3px; } #apply-to label span { position: relative; - top:1px; + top: 1px; } .input-cell label input { - margin-left:0px; + margin-left: 0px; } .error { - color:red; + color: red; } -.placeholder { - color:#c0c0c0; - font-size:11px; +.placeholder { + color: #c0c0c0; + font-size: 11px; } -::-moz-placeholder { /* Firefox 19+ */ - color: #c0c0c0; +::-moz-placeholder { + /* Firefox 19+ */ + color: #c0c0c0; } .advanced { - margin-top:8px; + margin-top: 8px; } .hidden { - display:none; + display: none; } #advanced-toggle { - padding-top:3px; + padding-top: 3px; text-align: center; } #advanced-toggle a { - color:rgb(21,90,233); + color: rgb(21, 90, 233); cursor: pointer; } @@ -497,44 +506,46 @@ a.disabled:hover, button[disabled]:hover { } .advanced div .input-cell label:first-child { - margin-top:2px; + margin-top: 2px; } .advanced div .input-cell select { - margin-top:4px; - width:160px; + margin-top: 4px; + width: 160px; } a[ng-click] { - cursor:pointer; + cursor: pointer; } -#wildcardtype, #regextype { - margin-right:10px; - display:inline-block; - margin-top:4px; +#wildcardtype, +#regextype { + margin-right: 10px; + display: inline-block; + margin-top: 4px; } .button-container { - margin-top:20px; + margin-top: 20px; text-align: center; - padding-bottom:10px; + padding-bottom: 10px; } /* Footer with link */ footer { - margin-top:30px; + margin-top: 30px; text-align: center; } footer small { - font-size:10px; - color:#555; + font-size: 10px; + color: #555; } -footer small a, footer small a:visited { +footer small a, +footer small a:visited { text-decoration: none; - color:rgb(21,90,233); + color: rgb(21, 90, 233); } footer small a:hover { @@ -547,22 +558,69 @@ footer small a:hover { } #storage-sync-option input { - margin:10px; + margin: 10px; +} + +/* Popup form for importing redirects */ +#import-popup { + position: fixed; + padding: 10px; + width: 35%; + background: white; + border: solid 1px #bbb; + border-radius: 3px; + z-index: 6000; + left: 50%; + top: 50%; + display: none; + transform: translate(-50%, -50%); +} + +#import-popup input { + font-weight: bold; + text-align: center; + display: inline-block; + vertical-align: top; + margin-bottom: 0.5rem; + padding: 4px 8px; +} + +.popup-content { + text-align: center; + margin-bottom: 7px; +} + +@media only screen and (max-width: 767px) { + #delete-redirect-form, + #edit-redirect-form, + #import-popup { + width: 85vw; + } } /* Dark mode support */ @media (prefers-color-scheme: dark) { - body { - background: rgb(32,33,36); + background: rgb(32, 33, 36); color: #bbb; } + #import-popup { + background: rgb(41, 42, 45); + border: solid 1px #888; + } + + #import-popup label { + color: white; + font-weight: normal; + } + h1 { color: #eee; } - h5, footer small { + h5, + footer small { color: #aaa; } @@ -570,19 +628,20 @@ footer small a:hover { color: white; } - footer small a, footer small a:visited { - color: rgb(138,179,241); + footer small a, + footer small a:visited { + color: rgb(138, 179, 241); } .redirect-row:nth-child(odd) { - background: rgb(31,32,35); + background: rgb(31, 32, 35); } .redirect-row:nth-child(even) { - background: rgb(41,42,45); + background: rgb(41, 42, 45); } .btn { - background-color: rgb(32,33,36); + background-color: rgb(32, 33, 36); border: solid 1px #777; } @@ -591,7 +650,7 @@ footer small a:hover { } .btn.green { - color: rgb(53,180,75); + color: rgb(53, 180, 75); } .toggle { @@ -599,29 +658,30 @@ footer small a:hover { } #message-box.success { - background-color: rgb(53,203,75);; + background-color: rgb(53, 203, 75); } #message-box.error { - background-color: rgb(252,87,84); + background-color: rgb(252, 87, 84); } - .redirect-table, .redirect-row { + .redirect-table, + .redirect-row { border-color: #555 !important; } .redirect-row h4 span.disabled-marker { - color:rgb(252,87,84) !important; + color: rgb(252, 87, 84) !important; } .btn.red { - color: rgb(252,87,84); + color: rgb(252, 87, 84); } .btn.grey[disabled]:hover { border: solid 1px #777 !important; - background: rgb(32,33,36) !important; - color:#555 !important;; + background: rgb(32, 33, 36) !important; + color: #555 !important; } .btn.grey:hover { @@ -631,43 +691,51 @@ footer small a:hover { } .btn.blue { - color: rgb(138,179,241); + color: rgb(138, 179, 241); } .redirect-row [data-bind="description"] { color: #eee; } - .redirect-info.disabled label, .redirect-info.disabled span, span.disabled, .redirect-info.disabled p, a.disabled, button[disabled] { - color:#555 !important; + .redirect-info.disabled label, + .redirect-info.disabled span, + span.disabled, + .redirect-info.disabled p, + a.disabled, + button[disabled] { + color: #555 !important; } - #edit-redirect-form, #delete-redirect-form { - background:rgb(41,42,45); + #edit-redirect-form, + #delete-redirect-form { + background: rgb(41, 42, 45); border: solid 1px #888; } - #advanced-toggle a, #advanced-toggle a:visited { - color: rgb(138,179,241); + #advanced-toggle a, + #advanced-toggle a:visited { + color: rgb(138, 179, 241); } h3 { color: #eee; } - #edit-redirect-form label, #delete-redirect-form label { + #edit-redirect-form label, + #delete-redirect-form label { color: white; font-weight: normal; } .example-result-error { - color:rgb(252,87,84) !important; + color: rgb(252, 87, 84) !important; } #edit-redirect-form input { - background: rgb(68,68,68); + background: rgb(68, 68, 68); color: #ddd; - border-color: rgb(68,68,68) !important ; + border-color: rgb(68, 68, 68) !important ; border-radius: 2px; } } diff --git a/help.html b/help.html index ec5c5b9..40a3f65 100644 --- a/help.html +++ b/help.html @@ -1,318 +1,341 @@ -
-Redirector is a browser extension that allows you to automatically redirect from - one webpage to another. For example, every time you visit http://abc.com you will automatically - load http://def.com instead. This can be useful for instance to always redirect articles to printer friendly - versions, redirect http:// to https:// for sites that support both, bypass advertising pages that appear before - being able to view certain pages and more.
-A new feature in v3.0 is that the result of a redirect will never be redirected again, even if it matches another include pattern. This is to prevent endless loops, for example if you have a pattern that redirects from a -> b and another that redirects from b -> a. This also removes the annoying message that the include pattern matches the result and therefore you can't create the redirect. That doesn't matter anymore because the result will never be redirected, even if it matches the include pattern again, so this should make it simpler for people to create redirects.
- - -To add a new redirect you press the Redirector icon next to your address bar, and in the popup that comes up you choose the Edit Redirects button. - On the settings page you can add, edit and delete redirect. Redirects will be checked in the same order as they are shown on that page, so you can move them - up or down to give them higher or lower priority. The edit form will guide you by showing you an example result as you're typing in your patterns. A redirect - contains the following fields: -
-Wildcards are the simplest way to specify include and exclude patterns. When you create a wildcard pattern there - is just one special character, the asterisk *. An asterisk in your pattern will match zero or more characters and you can - have more than one star in your pattern. Some examples: -
Regular expressions allow for more complicated patterns but they are a lot harder to learn than wildcards. I'm not gonna - create a regex tutorial here but normal javascript regex syntax works, look at Regular-Expressions.info for - an introduction to regular expressions. $1,$2 etc. can be used in the redirect url and will be replaced with contents of captures in - the regular expressions. Captures are specified with parentheses. Example: http://example.com/index.asp\?id=(\d+) will match the url - http://example.com/index.asp?id=12345 and $1 will be replaced by 12345. (A common mistake in regex patterns is to forget to escape - the ? sign in the querystring of the url. ? is a special character in regular expressions so if you want to match an url with a querystring - you should escape it as \?). To test your regular expressions, you may use any website or service. For example, RegExr.
- - -Storage Area, by default, is set to Local. If you wish to sync your redirector rules across devices, you may choose to enable Sync from Settings page. - When you toggle to Sync, data will be copied over to Sync storage and local storage will be deleted. - Similary, sync storage will be deleted if you disable sync and data will be moved to Local storage. -
Example URL: | -http://example.com/foo | -
---|---|
Include pattern: | -http://example.com/foo | -
Redirect to: | -http://example.com/bar | -
Pattern type: | -Wildcard | -
Example result: | -http://example.com/bar | -
Example URL: | -http://example.com/index.php?id=12345&a=b | -
---|---|
Include pattern: | -http://example.com/index.php?id=*&a=b | -
Redirect to: | -http://example.com/printerfriendly.php?id=$1&a=b | -
Pattern type: | -Wildcard | -
Example result: | -http://example.com/printerfriendly.php?id=12345&a=b | -
Example URL: | -http://example.com/index.php?id=12345&a=b | -
---|---|
Include pattern: | -http://example.com/index.php\?id=(\d+)&a=b | -
Redirect to: | -http://example.com/printerfriendly.php?id=$1&a=b | -
Pattern type: | -Regular Expression | -
Example result: | -http://example.com/printerfriendly.php?id=12345&a=b | -
Example URL: | -http://example.com/category/fish/index.php | -
---|---|
Include pattern: | -http://example.com/category/*/index.php | -
Exclude pattern: | -http://example.com/category/*/*/index.php | -
Redirect to: | -http://example.com/category/cat/index.php | -
Pattern type: | -Wildcard | -
Example result: | -http://example.com/category/cat/index.php | -
Example URL: | -http://mail.google.com/randomcharacters | -
---|---|
Include pattern: | -http://mail.google.com* | -
Redirect to: | -https://mail.google.com$1 | -
Pattern type: | -Wildcard | -
Example result: | -https://mail.google.com/randomcharacters | -
Redirector is a browser extension that allows you to automatically redirect from one webpage to another. For example, every time you visit https://abc.com you will automatically load https://def.com instead. This can be useful for instance to always redirect articles to printer friendly versions, redirect https:// to https:// for sites that support both, bypass advertising pages that appear before being able to view certain pages and more.
+A new feature in v3.0 is that the result of a redirect will never be redirected again, even if it matches another include pattern. This is to prevent endless loops, for example if you have a pattern that redirects from a -> b and another that redirects from b -> a. This also removes the annoying message that the include pattern matches the result and therefore you can't create the redirect. That doesn't matter anymore because the result will never be redirected, even if it matches the include pattern again, so this should make it simpler for people to create redirects.
+ +To add a new redirect you press the Redirector icon next to your address bar, and in the popup that comes up you choose the Edit Redirects button. On the settings page you can add, edit and delete redirect. Redirects will be checked in the same order as they are shown on that page, so you can move them up or down to give them higher or lower priority. The edit form will guide you by showing you an example result as you're typing in your patterns. A redirect contains the following fields:
+Wildcards are the simplest way to specify include and exclude patterns. When you create a wildcard pattern there is just one special character, the asterisk *. An asterisk in your pattern will match zero or more characters and you can have more than one star in your pattern. Some examples: +
Regular expressions allow for more complicated patterns but they are a lot harder to learn than wildcards. I'm not gonna create a regex tutorial here but normal javascript regex syntax works, look at Regular-Expressions.info for an introduction to regular expressions. $1,$2 etc. can be used in the redirect url and will be replaced with contents of captures in the regular expressions. Captures are specified with parentheses. Example: https://example.com/index.asp\?id=(\d+) will match the url https://example.com/index.asp?id=12345 and $1 will be replaced by 12345. (A common mistake in regex patterns is to forget to escape the ? sign in the querystring of the url. ? is a special character in regular expressions so if you want to match an url with a querystring you should escape it as \?). To test your regular expressions, you may use any website or service. For example, RegExr.
+ +Storage Area, by default, is set to Local. If you wish to sync your redirector rules across devices, you may choose to enable Sync from Settings page. When you toggle to Sync, data will be copied over to Sync storage and local storage will be deleted. Similary, sync storage will be deleted if you disable sync and data will be moved to Local storage. +
Example URL: | +https://example.com/foo | +
---|---|
Include pattern: | +https://example.com/foo | +
Redirect to: | +https://example.com/bar | +
Pattern type: | +Wildcard | +
Example result: | +https://example.com/bar | +
Example URL: | +https://example.com/index.php?id=12345&a=b | +
---|---|
Include pattern: | +https://example.com/index.php?id=*&a=b | +
Redirect to: | +https://example.com/printerfriendly.php?id=$1&a=b | +
Pattern type: | +Wildcard | +
Example result: | +https://example.com/printerfriendly.php?id=12345&a=b | +
Example URL: | +https://example.com/index.php?id=12345&a=b | +
---|---|
Include pattern: | +https://example.com/index.php\?id=(\d+)&a=b | +
Redirect to: | +https://example.com/printerfriendly.php?id=$1&a=b | +
Pattern type: | +Regular Expression | +
Example result: | +https://example.com/printerfriendly.php?id=12345&a=b | +
Example URL: | +https://example.com/category/fish/index.php | +
---|---|
Include pattern: | +https://example.com/category/*/index.php | +
Exclude pattern: | +https://example.com/category/*/*/index.php | +
Redirect to: | +https://example.com/category/cat/index.php | +
Pattern type: | +Wildcard | +
Example result: | +https://example.com/category/cat/index.php | +
Example URL: | +https://mail.google.com/randomcharacters | +
---|---|
Include pattern: | +https://mail.google.com* | +
Redirect to: | +https://mail.google.com$1 | +
Pattern type: | +Wildcard | +
Example result: | +https://mail.google.com/randomcharacters | +