Skip to content

Commit

Permalink
Add referrerpolicy=no-referrer to DDG favicons
Browse files Browse the repository at this point in the history
Fixes #343
  • Loading branch information
ukutaht committed Oct 15, 2020
1 parent 58a47fd commit 8803d9d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

### Fixed
- Fix issue with creating a PostgreSQL database when `?ssl=true` [plausible/analytics#347](https://github.com/plausible/analytics/issues/347)
- Do no disclose current URL to DuckDuckGo's favicon service [plausible/analytics#343](https://github.com/plausible/analytics/issues/343)

## [1.0.0] - 2020-10-06

Expand Down
4 changes: 2 additions & 2 deletions assets/js/dashboard/site-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class SiteSwitcher extends React.Component {
const extraClass = domain === this.props.site.domain ? 'font-medium text-gray-900' : 'hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900'
return (
<a href={`/${encodeURIComponent(domain)}`} key={domain} className={`block truncate px-4 py-2 text-sm leading-5 text-gray-700 ${extraClass}`}>
<img src={`https://icons.duckduckgo.com/ip3/${domain}.ico`} className="inline w-4 mr-2 align-middle" />
<img src={`https://icons.duckduckgo.com/ip3/${domain}.ico`} referrerPolicy="no-referrer" className="inline w-4 mr-2 align-middle" />
<span>{domain}</span>
</a>
)
Expand Down Expand Up @@ -94,7 +94,7 @@ export default class SiteSwitcher extends React.Component {
<div className="relative inline-block text-left z-10 mr-8">
<button onClick={this.toggle.bind(this)} className={`inline-flex items-center text-lg w-full rounded-md py-2 leading-5 font-bold text-gray-700 focus:outline-none transition ease-in-out duration-150 ${hoverClass}`}>

<img src={`https://icons.duckduckgo.com/ip3/${this.props.site.domain}.ico`} className="inline w-4 mr-2 align-middle" />
<img src={`https://icons.duckduckgo.com/ip3/${this.props.site.domain}.ico`} referrerPolicy="no-referrer" className="inline w-4 mr-2 align-middle" />
{this.props.site.domain}
{this.renderArrow()}
</button>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/modals/sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SourcesModal extends React.Component {
return (
<tr className="text-sm" key={source.name}>
<td className="p-2">
<img src={`https://icons.duckduckgo.com/ip3/${source.url}.ico`} className="h-4 w-4 mr-2 align-middle inline" />
<img src={`https://icons.duckduckgo.com/ip3/${source.url}.ico`} referrerPolicy="no-referrer" className="h-4 w-4 mr-2 align-middle inline" />
<Link className="hover:underline" to={{search: query.toString(), pathname: '/' + encodeURIComponent(this.props.site.domain)}}>{ source.name }</Link>
</td>
<td className="p-2 w-32 font-medium" align="right">{numberFormatter(source.count)}</td>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/sources/referrer-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class Referrers extends React.Component {
<Bar count={referrer.count} all={this.state.referrers} bg="bg-blue-50" />
<span className="flex px-2 group" style={{marginTop: '-26px'}} >
<LinkOption className="block truncate" to={{search: query.toString()}} disabled={referrer.name === 'Direct / None'}>
<img src={`https://icons.duckduckgo.com/ip3/${referrer.url}.ico`} className="inline h-4 w-4 mr-2 align-middle -mt-px" />
<img src={`https://icons.duckduckgo.com/ip3/${referrer.url}.ico`} referrerPolicy="no-referrer" className="inline h-4 w-4 mr-2 align-middle -mt-px" />
{ referrer.name }
</LinkOption>
{ this.renderExternalLink(referrer) }
Expand Down
1 change: 0 additions & 1 deletion assets/js/dashboard/stats/sources/search-terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default class SearchTerms extends React.Component {
<Bar count={term.count} all={this.state.searchTerms} bg="bg-blue-50" />
<span className="flex px-2" style={{marginTop: '-26px'}} >
<span className="block truncate">
<img src={`https://icons.duckduckgo.com/ip3/${term.url}.ico`} className="inline h-4 w-4 mr-2 align-middle -mt-px" />
{ term.name }
</span>
</span>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/sources/source-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AllSources extends React.Component {
<Bar count={referrer.count} all={this.state.referrers} bg="bg-blue-50" />
<span className="flex px-2" style={{marginTop: '-26px'}} >
<Link className="block truncate hover:underline" to={{search: query.toString()}}>
<img src={`https://icons.duckduckgo.com/ip3/${referrer.url}.ico`} className="inline h-4 w-4 mr-2 align-middle -mt-px" />
<img src={`https://icons.duckduckgo.com/ip3/${referrer.url}.ico`} referrerPolicy="no-referrer" className="inline h-4 w-4 mr-2 align-middle -mt-px" />
{ referrer.name }
</Link>
</span>
Expand Down

0 comments on commit 8803d9d

Please sign in to comment.