fix: remove mentions of ddg proxy due to them adding cors, cleanup etc

This commit is contained in:
David Ralph
2024-05-12 15:15:41 +01:00
parent 90425c30a5
commit 8f0ac31994
30 changed files with 19 additions and 131 deletions

View File

@@ -44,14 +44,6 @@ export default class Background extends PureComponent {
if (this.state.url !== '') {
let url = this.state.url;
if (
localStorage.getItem('ddgProxy') === 'true' &&
this.state.photoInfo.offline !== true &&
!this.state.url.startsWith('data:')
) {
url = variables.constants.DDG_IMAGE_PROXY + this.state.url;
}
const photoInformation = document.querySelector('.photoInformation');
// just set the background

View File

@@ -45,8 +45,7 @@ class Favourite extends PureComponent {
let url = document
.getElementById('backgroundImage')
.style.backgroundImage.replace('url("', '')
.replace('")', '')
.replace(variables.constants.DDG_IMAGE_PROXY, '');
.replace('")', '');
if (!url) {
return;

View File

@@ -96,18 +96,13 @@ function PhotoInformation({ info, url, api }) {
);
}
const ddgProxy = localStorage.getItem('ddgProxy') === 'true';
// get resolution
const img = new Image();
img.onload = (event) => {
setWidth(event.target.width);
setHeight(event.target.height);
};
img.src =
ddgProxy && !info.offline && !url.startsWith('data:')
? variables.constants.DDG_IMAGE_PROXY + url
: url;
img.src = url;
// info is still there because we want the favourite button to work
if (localStorage.getItem('photoInformation') === 'false') {

View File

@@ -414,14 +414,6 @@ class BackgroundOptions extends PureComponent {
)}
/>
<Action>
<Checkbox
name="ddgProxy"
text={variables.getMessage(
'modals.main.settings.sections.background.ddg_image_proxy',
)}
element=".other"
disabled={!usingImage}
/>
<Checkbox
name="bgtransition"
text={variables.getMessage('modals.main.settings.sections.background.transition')}

View File

@@ -2,15 +2,16 @@ import { MdOutlineArrowForward, MdOutlineOpenInNew } from 'react-icons/md';
import { Button } from 'components/Elements';
import variables from 'config/variables';
const Collection = ({ collection, toggle, collectionFunction }) => {
const { news, background_colour, img, display_name, description, name } = collection;
const Collection = ({ collection, collectionFunction }) => {
const { news, background_colour, img, display_name, description } = collection;
const getStyle = () => {
if (news) {
return { backgroundColor: background_colour };
}
return {
backgroundImage: `linear-gradient(to left, #000, transparent, #000), url('${variables.constants.DDG_IMAGE_PROXY + img}')`,
backgroundImage: `linear-gradient(to left, #000, transparent, #000), url('${img}')`,
};
};
@@ -38,16 +39,8 @@ const Collection = ({ collection, toggle, collectionFunction }) => {
iconPlacement={'right'}
/>
)}
{/*<Button
type="collection"
onClick={() => toggle('collection', name)}
icon={<MdOutlineArrowForward />}
label={variables.getMessage('modals.main.marketplace.explore_collection')}
iconPlacement="right"
/>*/}
</div>
);
};
export default Collection;
export { Collection };
export { Collection as default, Collection };

View File

@@ -3,8 +3,6 @@ import { MdOutlineArrowForwardIos, MdOutlineArrowBackIos } from 'react-icons/md'
import useEmblaCarousel from 'embla-carousel-react';
import Autoplay from 'embla-carousel-autoplay';
import variables from 'config/variables';
import './carousel.scss';
function EmblaCarousel({ data }) {
@@ -56,7 +54,7 @@ function EmblaCarousel({ data }) {
<div className="carousel_slide" key={index}>
<div className="carousel_slide_inner">
<img
src={variables.constants.DDG_IMAGE_PROXY + photo.url.default}
src={photo.url.default}
alt="Marketplace example screenshot"
/>
</div>

View File

@@ -21,7 +21,6 @@ import { Button } from 'components/Elements';
import { install, uninstall } from 'utils/marketplace';
import { Carousel } from '../Elements/Carousel';
import { ShareModal } from 'components/Elements';
import { MdClose } from 'react-icons/md';
class Item extends PureComponent {
constructor(props) {
@@ -69,7 +68,7 @@ class Item extends PureComponent {
}
// prevent console error
let iconsrc = variables.constants.DDG_IMAGE_PROXY + this.props.data.icon;
let iconsrc = this.props.data.icon;
if (!this.props.data.icon) {
iconsrc = null;
}
@@ -263,7 +262,7 @@ class Item extends PureComponent {
className="itemInfo"
style={{
backgroundImage: `url("${
variables.constants.DDG_IMAGE_PROXY + this.props.data.data.icon_url
this.props.data.data.icon_url
}")`,
}}
>
@@ -272,7 +271,7 @@ class Item extends PureComponent {
className="icon"
alt="icon"
draggable={false}
src={variables.constants.DDG_IMAGE_PROXY + this.props.data.data.icon_url}
src={this.props.data.data.icon_url}
/>
{this.props.button}
<div className="iconButtons">

View File

@@ -3,7 +3,6 @@ import React, { memo } from 'react';
import { MdAutoFixHigh, MdOutlineArrowForward, MdOutlineOpenInNew } from 'react-icons/md';
import { Button } from 'components/Elements';
import MemoizedLightbox from '../Elements/Lightbox/Lightbox';
function Items({
type,
@@ -69,14 +68,14 @@ function Items({
className="item-back"
alt=""
draggable={false}
src={variables.constants.DDG_IMAGE_PROXY + item.icon_url}
src={item.icon_url}
aria-hidden="true"
/>
<img
className="item-icon"
alt="icon"
draggable={false}
src={variables.constants.DDG_IMAGE_PROXY + item.icon_url}
src={item.icon_url}
/>
<div className="card-details">
<span className="card-title">{item.display_name || item.name}</span>

View File

@@ -344,7 +344,7 @@ class Marketplace extends PureComponent {
<div
className="collectionPage"
style={{
backgroundImage: `linear-gradient(to bottom, transparent, black), url('${variables.constants.DDG_IMAGE_PROXY + this.state.collectionImg}')`,
backgroundImage: `linear-gradient(to bottom, transparent, black), url('${this.state.collectionImg}')`,
}}
>
<div className="nice-tag">
@@ -415,7 +415,7 @@ class Marketplace extends PureComponent {
item.news
? { backgroundColor: item.background_colour }
: {
backgroundImage: `linear-gradient(to left, #000, transparent, #000), url('${variables.constants.DDG_IMAGE_PROXY + item.img}')`,
backgroundImage: `linear-gradient(to left, #000, transparent, #000), url('${item.img}')`,
}
}
>

View File

@@ -2,8 +2,8 @@ import variables from 'config/variables';
import { PureComponent, createRef } from 'react';
import { MdSearch, MdMic, MdScreenSearchDesktop } from 'react-icons/md';
import { BsGoogle } from 'react-icons/bs';
import { SiDuckduckgo, SiMicrosoftbing, SiYahoo, SiBaidu } from 'react-icons/si';
import { FaYandex } from 'react-icons/fa';
import { SiDuckduckgo, SiMicrosoftbing, SiBaidu } from 'react-icons/si';
import { FaYandex, FaYahoo } from 'react-icons/fa';
import { Tooltip } from 'components/Elements';
import { Autocomplete as AutocompleteInput } from './components/autocomplete';
@@ -191,7 +191,7 @@ export default class Search extends PureComponent {
return <SiMicrosoftbing />;
case 'Yahoo':
case 'Yahoo! JAPAN':
return <SiYahoo />;
return <FaYahoo />;
case 'Яндекс':
return <FaYandex />;
case '百度':

View File

@@ -18,20 +18,6 @@ function OfflineMode() {
);
}
function DuckDuckGoProxy() {
return (
<>
<Checkbox
name="ddgProxy"
text={`${variables.getMessage('modals.main.settings.sections.background.ddg_image_proxy')} (${variables.getMessage('modals.main.settings.sections.background.title')})`}
/>
<span className="subtitle">
{variables.getMessage('modals.welcome.sections.privacy.ddg_proxy_description')}
</span>
</>
);
}
function Links() {
return (
<>
@@ -69,7 +55,6 @@ function PrivacyOptions() {
subtitle={variables.getMessage('modals.welcome.sections.privacy.description')}
/>
<OfflineMode />
<DuckDuckGoProxy />
<Links />
</Content>
);