Remove compat scripts and move API URL redirection to contentSetup

This commit is contained in:
hensm
2019-03-14 09:42:00 +00:00
parent 870a759251
commit 410d6a267b
8 changed files with 92 additions and 109 deletions

View File

@@ -10,6 +10,7 @@ import Bridge from "./Bridge";
import EditableList from "./EditableList";
import getBridgeInfo, { BridgeInfo } from "../lib/getBridgeInfo";
import { REMOTE_MATCH_PATTERN_REGEX } from "../lib/utils";
const _ = browser.i18n.getMessage;
@@ -26,8 +27,6 @@ browser.runtime.getPlatformInfo()
});
const MATCH_PATTERN_REGEX = /^(?:(?:(\*|https?|ftp):\/\/((?:\*\.|[^\/\*])+)|(file):\/\/\/?(?:\*\.|[^\/\*])+)(\/.*)|<all_urls>)$/;
function getInputValue (input: HTMLInputElement) {
switch (input.type) {
case "checkbox":
@@ -236,7 +235,7 @@ class OptionsApp extends Component<{}, OptionsAppState> {
</div>
<EditableList data={ this.state.options.userAgentWhitelist }
onChange={ this.handleWhitelistChange }
itemPattern={ MATCH_PATTERN_REGEX }
itemPattern={ REMOTE_MATCH_PATTERN_REGEX }
itemPatternError={ this.getWhitelistItemPatternError } />
</div>
</fieldset>