;
@@ -27,13 +27,13 @@ const Header = () =>
const Footer = () =>
;
const HubLink = () =>
+ title="Discourse community forum">
Hub
;
@@ -44,13 +44,13 @@ const GitHubLink = () =>
const ApiLink = () =>
+ title="API lists endpoint">
API
;
const DonateLink = () =>
+ title="Support with Beerpay">
Donate
;
diff --git a/src/FilterLists.Web/src/Routes.tsx b/src/FilterLists.Web/src/Routes.tsx
index fcb6a93a0..1409781f1 100644
--- a/src/FilterLists.Web/src/Routes.tsx
+++ b/src/FilterLists.Web/src/Routes.tsx
@@ -4,10 +4,10 @@ import { Route, Redirect, Switch } from "react-router-dom";
import { Home } from "./modules";
export const Routes =
-
-
-
-
-
-
- ;
\ No newline at end of file
+
+
+
+
+
+
+;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/index.tsx b/src/FilterLists.Web/src/index.tsx
index 87d1be551..563c9482c 100644
--- a/src/FilterLists.Web/src/index.tsx
+++ b/src/FilterLists.Web/src/index.tsx
@@ -2,11 +2,5 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
-import * as serviceWorker from './serviceWorker';
-ReactDOM.render(, document.getElementById('root'));
-
-// If you want your app to work offline and load faster, you can change
-// unregister() to register() below. Note this comes with some pitfalls.
-// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister();
+ReactDOM.render(, document.getElementById('root'));
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/HomeContainer.tsx b/src/FilterLists.Web/src/modules/home/HomeContainer.tsx
index 30c403eb5..d782f1c5b 100644
--- a/src/FilterLists.Web/src/modules/home/HomeContainer.tsx
+++ b/src/FilterLists.Web/src/modules/home/HomeContainer.tsx
@@ -38,7 +38,7 @@ export class HomeContainer extends React.Component<{}, IState> {
componentDidMount() {
this.fetchLists();
this.fetchLanguages();
- this.fetchLicenses();
+ this.fetchLicenses();
this.fetchMaintainers();
this.fetchSoftware();
this.fetchSyntaxes();
diff --git a/src/FilterLists.Web/src/modules/home/components/Oneliner.tsx b/src/FilterLists.Web/src/modules/home/components/Oneliner.tsx
index 5ad124110..aa87adc52 100644
--- a/src/FilterLists.Web/src/modules/home/components/Oneliner.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/Oneliner.tsx
@@ -7,11 +7,11 @@ interface IProps {
export const Oneliner = (props: IProps) =>
props.listCount > 0/* && props.ruleCount > 0*/
- ?
+ ?
The independent, comprehensive directory of {/*}{props.ruleCount.toLocaleString()
} unique rules across */}{props.listCount.toLocaleString()
- } filter and host lists for advertisements, trackers, malware, and annoyances.
+ } filter and host lists for advertisements, trackers, malware, and annoyances.
- :
- The independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances.
+ :
+ The independent, comprehensive directory of filter and host lists for advertisements, trackers, malware, and annoyances.
;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/TagGroup.tsx b/src/FilterLists.Web/src/modules/home/components/TagGroup.tsx
index 03defe587..0b4eb85dd 100644
--- a/src/FilterLists.Web/src/modules/home/components/TagGroup.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/TagGroup.tsx
@@ -8,10 +8,10 @@ interface IProps {
export const TagGroup = (props: IProps) =>
props.tags && props.tags.length > 0
- ?
;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/Description.tsx b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/Description.tsx
index 983c14924..a65ec9f28 100644
--- a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/Description.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/Description.tsx
@@ -8,9 +8,9 @@ interface IProps {
export const Description = (props: IProps) =>
props.description
- ?
- {props.url
- ?
{props.description}
- : props.description}
-
- : null;
\ No newline at end of file
+ ?
+ {props.url
+ ?
{props.description}
+ : props.description}
+
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/RuleCount.tsx b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/RuleCount.tsx
index 1fb5944bf..4fff08cba 100644
--- a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/RuleCount.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/RuleCount.tsx
@@ -6,7 +6,7 @@ interface IProps {
export const RuleCount = (props: IProps) =>
props.ruleCount > 0
- ?
-
Rule Count: {props.ruleCount.toLocaleString()}
-
- : null;
\ No newline at end of file
+ ?
+
Rule Count: {props.ruleCount.toLocaleString()}
+
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/index.ts b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/index.ts
index f90900e68..e054a3cee 100644
--- a/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/detailsExpander/infoCard/index.ts
@@ -2,4 +2,4 @@
export {
InfoCard
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/MaintainerLinkButtonGroup.tsx b/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/MaintainerLinkButtonGroup.tsx
index 9bd900bef..b4af33292 100644
--- a/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/MaintainerLinkButtonGroup.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/MaintainerLinkButtonGroup.tsx
@@ -10,7 +10,7 @@ interface IProps {
export const MaintainerLinkButtonGroup = (props: IProps) =>
-
-
-
+
+
+
;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/index.ts b/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/index.ts
index 03a112e6e..ba527225b 100644
--- a/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/detailsExpander/maintainersInfoCard/index.ts
@@ -2,4 +2,4 @@
export {
MaintainersInfoCard
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/index.ts b/src/FilterLists.Web/src/modules/home/components/index.ts
index 180723286..956aaf11e 100644
--- a/src/FilterLists.Web/src/modules/home/components/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/index.ts
@@ -6,4 +6,4 @@ export {
DetailsExpander,
ListsTable,
Oneliner
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/ChatButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/ChatButton.tsx
index f04b23e12..dbec3d0b2 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/ChatButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/ChatButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const ChatButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/DonateButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/DonateButton.tsx
index 03713ae48..0a7aec992 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/DonateButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/DonateButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const DonateButton = (props: IProps) =>
props.url
- ?
- : null;
+ ?
+ : null;
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/EmailButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/EmailButton.tsx
index edc8e9972..1fdc06b09 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/EmailButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/EmailButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const EmailButton = (props: IProps) =>
props.emailAddress
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/ForumButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/ForumButton.tsx
index 0bf0bacfc..ba9cf1ea4 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/ForumButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/ForumButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const ForumButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/HomeButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/HomeButton.tsx
index e1f40b366..c73832814 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/HomeButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/HomeButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const HomeButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/IssuesButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/IssuesButton.tsx
index 038ab763f..dd4a3d9f8 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/IssuesButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/IssuesButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const IssuesButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/LinkButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/LinkButton.tsx
index 66af40654..986fb302b 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/LinkButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/LinkButton.tsx
@@ -10,9 +10,9 @@ interface IProps {
export const LinkButton = (props: IProps) =>
props.href
- ?
- {props.text}
-
- : null;
\ No newline at end of file
+ ?
+ {props.text}
+
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/PolicyButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/PolicyButton.tsx
index 60b87d795..8369d5f3b 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/PolicyButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/PolicyButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const PolicyButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubmitButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubmitButton.tsx
index e4baef971..dc2beada9 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubmitButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubmitButton.tsx
@@ -8,7 +8,7 @@ interface IProps {
export const SubmitButton = (props: IProps) =>
props.url
- ?
- : null;
\ No newline at end of file
+ ?
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButton.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButton.tsx
index e3d7d2b99..9cc451446 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButton.tsx
@@ -10,7 +10,7 @@ interface IProps {
export const SubscribeButton = (props: IProps) => {
let buttonClass: string | undefined;
let titlePrefix: string;
-
+
if (props.url.indexOf(".onion/") > 0) {
buttonClass = "btn-success";
titlePrefix = "Tor address - ";
@@ -21,42 +21,36 @@ export const SubscribeButton = (props: IProps) => {
buttonClass = undefined;
titlePrefix = "";
}
-
+
const hrefTitle = `${encodeURIComponent(props.name)}`;
let href;
-if (props.url.indexOf(".tpl") > 0)
-{
- href = `javascript:window.external.msAddTrackingProtectionList('${encodeURIComponent(props.url)}', '${hrefTitle}')`;
-} else if (props.url.indexOf(".lsrules") > 0)
-{
- href = `x-littlesnitch:subscribe-rules?url=${encodeURIComponent(props.url)}`;
-} else if (props.url.indexOf("?hostformat=littlesnitch") > 0)
-{
- href = `x-littlesnitch:subscribe-rules?url=${encodeURIComponent(props.url)}`;
-} else {
- href = `abp:subscribe?location=${encodeURIComponent(props.url)}&title=${hrefTitle}`;
-};
-
-
-
+ if (props.url.indexOf(".tpl") > 0) {
+ href = `javascript:window.external.msAddTrackingProtectionList('${encodeURIComponent(props.url)}', '${hrefTitle}')`;
+ } else if (props.url.indexOf(".lsrules") > 0) {
+ href = `x-littlesnitch:subscribe-rules?url=${encodeURIComponent(props.url)}`;
+ } else if (props.url.indexOf("?hostformat=littlesnitch") > 0) {
+ href = `x-littlesnitch:subscribe-rules?url=${encodeURIComponent(props.url)}`;
+ } else {
+ href = `abp:subscribe?location=${encodeURIComponent(props.url)}&title=${hrefTitle}`;
+ };
+
+
+
let title;
-if (props.url.indexOf(".tpl") > 0)
-{
- title = `${titlePrefix}Subscribe to ${props.name} with Internet Explorer's Tracking Protection List feature.`;
-} else if (props.url.indexOf(".lsrules") > 0)
-{
- title = `${titlePrefix}Subscribe to ${props.name} with Little Snitch's rule group subscription feature.`;
-} else if (props.url.indexOf("?hostformat=littlesnitch") > 0)
-{
- title = `${titlePrefix}Subscribe to ${props.name} with Little Snitch's rule group subscription feature.`;
-} else {
- title = `${titlePrefix}Subscribe to ${props.name} with a browser extension supporting the "abp:" protocol (e.g. uBlock Origin, Adblock Plus).`;
-};
+ if (props.url.indexOf(".tpl") > 0) {
+ title = `${titlePrefix}Subscribe to ${props.name} with Internet Explorer's Tracking Protection List feature.`;
+ } else if (props.url.indexOf(".lsrules") > 0) {
+ title = `${titlePrefix}Subscribe to ${props.name} with Little Snitch's rule group subscription feature.`;
+ } else if (props.url.indexOf("?hostformat=littlesnitch") > 0) {
+ title = `${titlePrefix}Subscribe to ${props.name} with Little Snitch's rule group subscription feature.`;
+ } else {
+ title = `${titlePrefix}Subscribe to ${props.name} with a browser extension supporting the "abp:" protocol (e.g. uBlock Origin, Adblock Plus).`;
+ };
return props.url
- ?
- : null;
+ ?
+ : null;
};
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButtonGroup.tsx b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButtonGroup.tsx
index e6315284c..1a9e4604e 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButtonGroup.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/SubscribeButtonGroup.tsx
@@ -9,11 +9,11 @@ interface IProps {
export const SubscribeButtonGroup = (props: IProps) =>
props.url
- ? (props.urlMirrors && props.urlMirrors.length > 0)
- ?
- :
- : null;
+ ? (props.urlMirrors && props.urlMirrors.length > 0)
+ ?
+ :
+ : null;
interface ISubscribeButtonGroupDropdownProps {
name: string;
@@ -31,22 +31,22 @@ const SubscribeButtonGroupDropdown = (props: ISubscribeButtonGroupDropdownProps)
}
return
+ ;
};
const BtnGroupDropView = () =>
;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/linkButtons/index.ts b/src/FilterLists.Web/src/modules/home/components/linkButtons/index.ts
index c0525f2df..b5255a105 100644
--- a/src/FilterLists.Web/src/modules/home/components/linkButtons/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/linkButtons/index.ts
@@ -22,4 +22,4 @@ export {
SubscribeButtonGroup,
TwitterButton,
ViewButtonGroup
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/DetailsButton.tsx b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/DetailsButton.tsx
index 7c7955fb6..26d405b06 100644
--- a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/DetailsButton.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/DetailsButton.tsx
@@ -15,12 +15,12 @@ export const DetailsButton = {
const Expander = (props: RowRenderProps) =>
{props.isExpanded
- ?
;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/Name.tsx b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/Name.tsx
index 12ad09716..ab74d9497 100644
--- a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/Name.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/Name.tsx
@@ -18,5 +18,5 @@ const sortMethod = (a: string, b: string) =>
const Cell = (name: string) =>
name
- ?
{name}
- : null;
\ No newline at end of file
+ ?
{name}
+ : null;
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/index.ts b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/index.ts
index 050780af2..a2a6c5411 100644
--- a/src/FilterLists.Web/src/modules/home/components/listsTable/columns/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/listsTable/columns/index.ts
@@ -22,4 +22,4 @@ export {
Syntax,
Tags,
UpdatedDate
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/listsTable/index.ts b/src/FilterLists.Web/src/modules/home/components/listsTable/index.ts
index 48483597b..08d82a9e1 100644
--- a/src/FilterLists.Web/src/modules/home/components/listsTable/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/listsTable/index.ts
@@ -2,4 +2,4 @@
export {
ListsTable,
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/components/softwareIcon/SoftwareIcon.tsx b/src/FilterLists.Web/src/modules/home/components/softwareIcon/SoftwareIcon.tsx
index 03aff3b5d..116ade61e 100644
--- a/src/FilterLists.Web/src/modules/home/components/softwareIcon/SoftwareIcon.tsx
+++ b/src/FilterLists.Web/src/modules/home/components/softwareIcon/SoftwareIcon.tsx
@@ -41,11 +41,11 @@ interface IProps {
export const SoftwareIcon = (props: IProps) =>
icons[props.id]
- ?
- : null;
+ ?
+ : null;
interface IIcon {
image: any;
diff --git a/src/FilterLists.Web/src/modules/home/components/softwareIcon/imgs/index.ts b/src/FilterLists.Web/src/modules/home/components/softwareIcon/imgs/index.ts
index 00cb09611..6c195031e 100644
--- a/src/FilterLists.Web/src/modules/home/components/softwareIcon/imgs/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/softwareIcon/imgs/index.ts
@@ -66,4 +66,4 @@ export {
img32,
img33,
img34
- };
+};
diff --git a/src/FilterLists.Web/src/modules/home/components/softwareIcon/index.ts b/src/FilterLists.Web/src/modules/home/components/softwareIcon/index.ts
index 2dca6d6c1..8fa0f379c 100644
--- a/src/FilterLists.Web/src/modules/home/components/softwareIcon/index.ts
+++ b/src/FilterLists.Web/src/modules/home/components/softwareIcon/index.ts
@@ -2,4 +2,4 @@
export {
SoftwareIcon
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/home/index.ts b/src/FilterLists.Web/src/modules/home/index.ts
index f53b5d5c0..5fe1540b0 100644
--- a/src/FilterLists.Web/src/modules/home/index.ts
+++ b/src/FilterLists.Web/src/modules/home/index.ts
@@ -2,4 +2,4 @@
export {
HomeContainer as Home
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/modules/index.ts b/src/FilterLists.Web/src/modules/index.ts
index d4c28103a..319820928 100644
--- a/src/FilterLists.Web/src/modules/index.ts
+++ b/src/FilterLists.Web/src/modules/index.ts
@@ -2,4 +2,4 @@
export {
Home
- };
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/src/FilterLists.Web/src/serviceWorker.ts b/src/FilterLists.Web/src/serviceWorker.ts
deleted file mode 100644
index 15d90cb81..000000000
--- a/src/FilterLists.Web/src/serviceWorker.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-// This optional code is used to register a service worker.
-// register() is not called by default.
-
-// This lets the app load faster on subsequent visits in production, and gives
-// it offline capabilities. However, it also means that developers (and users)
-// will only see deployed updates on subsequent visits to a page, after all the
-// existing tabs open on the page have been closed, since previously cached
-// resources are updated in the background.
-
-// To learn more about the benefits of this model and instructions on how to
-// opt-in, read https://bit.ly/CRA-PWA
-
-const isLocalhost = Boolean(
- window.location.hostname === 'localhost' ||
- // [::1] is the IPv6 localhost address.
- window.location.hostname === '[::1]' ||
- // 127.0.0.1/8 is considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
-);
-
-type Config = {
- onSuccess?: (registration: ServiceWorkerRegistration) => void;
- onUpdate?: (registration: ServiceWorkerRegistration) => void;
-};
-
-export function register(config?: Config) {
- if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
- // The URL constructor is available in all browsers that support SW.
- const publicUrl = new URL(
- (process as { env: { [key: string]: string } }).env.PUBLIC_URL,
- window.location.href
- );
- if (publicUrl.origin !== window.location.origin) {
- // Our service worker won't work if PUBLIC_URL is on a different origin
- // from what our page is served on. This might happen if a CDN is used to
- // serve assets; see https://github.com/facebook/create-react-app/issues/2374
- return;
- }
-
- window.addEventListener('load', () => {
- const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
-
- if (isLocalhost) {
- // This is running on localhost. Let's check if a service worker still exists or not.
- checkValidServiceWorker(swUrl, config);
-
- // Add some additional logging to localhost, pointing developers to the
- // service worker/PWA documentation.
- navigator.serviceWorker.ready.then(() => {
- console.log(
- 'This web app is being served cache-first by a service ' +
- 'worker. To learn more, visit https://bit.ly/CRA-PWA'
- );
- });
- } else {
- // Is not localhost. Just register service worker
- registerValidSW(swUrl, config);
- }
- });
- }
-}
-
-function registerValidSW(swUrl: string, config?: Config) {
- navigator.serviceWorker
- .register(swUrl)
- .then(registration => {
- registration.onupdatefound = () => {
- const installingWorker = registration.installing;
- if (installingWorker == null) {
- return;
- }
- installingWorker.onstatechange = () => {
- if (installingWorker.state === 'installed') {
- if (navigator.serviceWorker.controller) {
- // At this point, the updated precached content has been fetched,
- // but the previous service worker will still serve the older
- // content until all client tabs are closed.
- console.log(
- 'New content is available and will be used when all ' +
- 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
- );
-
- // Execute callback
- if (config && config.onUpdate) {
- config.onUpdate(registration);
- }
- } else {
- // At this point, everything has been precached.
- // It's the perfect time to display a
- // "Content is cached for offline use." message.
- console.log('Content is cached for offline use.');
-
- // Execute callback
- if (config && config.onSuccess) {
- config.onSuccess(registration);
- }
- }
- }
- };
- };
- })
- .catch(error => {
- console.error('Error during service worker registration:', error);
- });
-}
-
-function checkValidServiceWorker(swUrl: string, config?: Config) {
- // Check if the service worker can be found. If it can't reload the page.
- fetch(swUrl)
- .then(response => {
- // Ensure service worker exists, and that we really are getting a JS file.
- const contentType = response.headers.get('content-type');
- if (
- response.status === 404 ||
- (contentType != null && contentType.indexOf('javascript') === -1)
- ) {
- // No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister().then(() => {
- window.location.reload();
- });
- });
- } else {
- // Service worker found. Proceed as normal.
- registerValidSW(swUrl, config);
- }
- })
- .catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
- });
-}
-
-export function unregister() {
- if ('serviceWorker' in navigator) {
- navigator.serviceWorker.ready.then(registration => {
- registration.unregister();
- });
- }
-}
diff --git a/src/FilterLists.Web/src/utils/index.ts b/src/FilterLists.Web/src/utils/index.ts
index ecd02f727..43c057d47 100644
--- a/src/FilterLists.Web/src/utils/index.ts
+++ b/src/FilterLists.Web/src/utils/index.ts
@@ -2,4 +2,4 @@
export {
getContrast
- };
\ No newline at end of file
+};
\ No newline at end of file