mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 09:39:58 +00:00
Implement user agent switching + whitelist
This commit is contained in:
@@ -28,6 +28,8 @@ class OptionsApp extends Component {
|
||||
options: {
|
||||
option_localMediaEnabled: this.state.option_localMediaEnabled
|
||||
, option_localMediaServerPort: this.state.option_localMediaServerPort
|
||||
, option_uaWhitelistEnabled: this.state.option_uaWhitelistEnabled
|
||||
, option_uaWhitelist: this.state.option_uaWhitelist
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -37,6 +39,7 @@ class OptionsApp extends Component {
|
||||
*/
|
||||
async componentDidMount () {
|
||||
const { options } = await browser.storage.sync.get("options");
|
||||
|
||||
if (options) {
|
||||
this.setState({
|
||||
...options
|
||||
@@ -80,8 +83,6 @@ class OptionsApp extends Component {
|
||||
}
|
||||
};
|
||||
|
||||
console.log(ev.target.name);
|
||||
|
||||
this.setState({
|
||||
[ ev.target.name ]: val
|
||||
});
|
||||
@@ -124,6 +125,36 @@ class OptionsApp extends Component {
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset className="category">
|
||||
<legend className="category-name">
|
||||
{ _("options_category_uaWhitelist") }
|
||||
</legend>
|
||||
<p className="category-description">
|
||||
{ _("options_category_uaWhitelist_description") }
|
||||
</p>
|
||||
|
||||
<label className="option">
|
||||
<div className="option-label">
|
||||
{ _("options_option_uaWhitelistEnabled") }
|
||||
</div>
|
||||
<input name="option_uaWhitelistEnabled"
|
||||
type="checkbox"
|
||||
checked={ this.state.option_uaWhitelistEnabled }
|
||||
onChange={ this.handleInputChange } />
|
||||
</label>
|
||||
|
||||
<label className="option">
|
||||
<div className="option-label">
|
||||
{ _("options_option_uaWhitelist") }
|
||||
</div>
|
||||
<textarea name="option_uaWhitelist"
|
||||
value={this.state.option_uaWhitelist}
|
||||
required
|
||||
onChange={ this.handleInputChange }>
|
||||
</textarea>
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<div id="buttons">
|
||||
<button type="submit"
|
||||
disabled={ !this.state.isFormValid }>
|
||||
|
||||
Reference in New Issue
Block a user