-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In past, it was opt-out via redirect opt-out per hostname. This changes default behavior and disables redirect of DNSLink websites to local gateway, as noted in #701 Adds DNSLink section to Preferences screen. Closes #701, #667
- Loading branch information
Showing
8 changed files
with
101 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
'use strict' | ||
/* eslint-env browser, webextensions */ | ||
|
||
const browser = require('webextension-polyfill') | ||
const html = require('choo/html') | ||
const switchToggle = require('../../pages/components/switch-toggle') | ||
|
||
function dnslinkForm ({ | ||
dnslinkPolicy, | ||
dnslinkRedirect, | ||
onOptionChange | ||
}) { | ||
const onDnslinkPolicyChange = onOptionChange('dnslinkPolicy') | ||
const onDnslinkRedirectChange = onOptionChange('dnslinkRedirect') | ||
|
||
return html` | ||
<form> | ||
<fieldset> | ||
<legend>${browser.i18n.getMessage('option_header_dnslink')}</legend> | ||
<div> | ||
<label for="dnslinkPolicy"> | ||
<dl> | ||
<dt>${browser.i18n.getMessage('option_dnslinkPolicy_title')}</dt> | ||
<dd> | ||
${browser.i18n.getMessage('option_dnslinkPolicy_description')} | ||
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/blob/master/docs/dnslink.md#dnslink-support-in-ipfs-companion" target="_blank"> | ||
${browser.i18n.getMessage('option_legend_readMore')} | ||
</a></p> | ||
</dd> | ||
</dl> | ||
</label> | ||
<select id="dnslinkPolicy" name='dnslinkPolicy' onchange=${onDnslinkPolicyChange}> | ||
<option | ||
value='false' | ||
selected=${String(dnslinkPolicy) === 'false'}> | ||
${browser.i18n.getMessage('option_dnslinkPolicy_disabled')} | ||
</option> | ||
<option | ||
value='best-effort' | ||
selected=${dnslinkPolicy === 'best-effort'}> | ||
${browser.i18n.getMessage('option_dnslinkPolicy_bestEffort')} | ||
</option> | ||
<option | ||
value='enabled' | ||
selected=${dnslinkPolicy === 'enabled'}> | ||
${browser.i18n.getMessage('option_dnslinkPolicy_enabled')} | ||
</option> | ||
</select> | ||
</div> | ||
<div> | ||
<label for="dnslinkRedirect"> | ||
<dl> | ||
<dt>${browser.i18n.getMessage('option_dnslinkRedirect_title')}</dt> | ||
<dd> | ||
${browser.i18n.getMessage('option_dnslinkRedirect_description')} | ||
${dnslinkRedirect ? html`<p class="red i">${browser.i18n.getMessage('option_dnslinkRedirect_warning')}</p>` : null} | ||
<p><a href="https://github.com/ipfs-shipyard/ipfs-companion/issues/667" target="_blank"> | ||
${browser.i18n.getMessage('option_legend_readMore')} | ||
</a></p> | ||
</dd> | ||
</dl> | ||
</label> | ||
<div>${switchToggle({ id: 'dnslinkRedirect', checked: dnslinkRedirect, onchange: onDnslinkRedirectChange })}</div> | ||
</div> | ||
</fieldset> | ||
</form> | ||
` | ||
} | ||
|
||
module.exports = dnslinkForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters