Skip to content

Commit 6435bbf

Browse files
authored
Merge pull request #201 from medyo/develop
New Release #minor
2 parents f4d27db + 0a104e6 commit 6435bbf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2926
-481
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2121

2222
- name: Set up Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '16'
25+
node-version: 18
2626

2727
- name: Install dependencies
2828
run: yarn

.github/workflows/distribute.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
tag_version:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636
with:
3737
fetch-depth: 0
3838

@@ -64,10 +64,10 @@ jobs:
6464
needs: tag_version
6565
runs-on: ubuntu-latest
6666
steps:
67-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v4
6868
with:
6969
ref: master
70-
- uses: actions/cache@v2
70+
- uses: actions/cache@v4
7171
with:
7272
path: '**/node_modules'
7373
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
@@ -91,13 +91,17 @@ jobs:
9191
needs: tag_version
9292
runs-on: ubuntu-latest
9393
steps:
94-
- uses: actions/checkout@v2
94+
- uses: actions/checkout@v4
9595
with:
9696
ref: master
97-
- uses: actions/cache@v2
97+
- uses: actions/cache@v4
9898
with:
9999
path: '**/node_modules'
100100
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
101+
- name: Set up Node.js
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: 18
101105
- name: Install yarn dependencies
102106
run: yarn
103107

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.20.0

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@
99
"@tanstack/react-query-persist-client": "^5.8.4",
1010
"@types/dompurify": "^2.3.4",
1111
"@types/jspath": "^0.4.0",
12-
"axios": "^0.21.2",
12+
"axios": "^1.8.4",
1313
"axios-cache-adapter": "^2.7.3",
1414
"country-emoji": "^1.5.4",
15-
"dompurify": "^2.2.7",
15+
"dompurify": "^3.2.4",
16+
"firebase": "^11.2.0",
1617
"htmlparser2": "^8.0.1",
1718
"jsonpath": "^1.1.1",
1819
"normalize.css": "^8.0.1",
1920
"prop-types": "^15.0.0-0",
2021
"react": "^17.0.1",
2122
"react-contexify": "^5.0.0",
22-
"react-device-detect": "^1.17.0",
2323
"react-dom": "^17.0.1",
2424
"react-easy-sort": "^1.5.1",
2525
"react-error-boundary": "^3.1.4",
2626
"react-icons": "^5.2.1",
2727
"react-markdown": "^7.0.1",
2828
"react-modal": "^3.12.1",
29+
"react-responsive": "^10.0.1",
2930
"react-router-dom": "^6.21.0",
3031
"react-select": "^5.0.1",
3132
"react-share": "^4.4.1",
@@ -40,6 +41,9 @@
4041
"web-vitals": "^0.2.4",
4142
"zustand": "^4.3.3"
4243
},
44+
"engines": {
45+
"node": "18"
46+
},
4347
"scripts": {
4448
"start": "vite",
4549
"preview": "vite preview",
@@ -91,7 +95,7 @@
9195
"prettier": "^2.7.1",
9296
"terser": "^5.19.2",
9397
"typescript": "^5.1.6",
94-
"vite": "^4.4.5",
98+
"vite": "^6.2.3",
9599
"vite-plugin-svgr": "^3.2.0",
96100
"vite-tsconfig-paths": "^4.2.0"
97101
}

public/auth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
window.addEventListener('message', (event) => {
2+
if (event.data.type === 'TOKEN_RECEIVED') {
3+
// Forward to content script
4+
window.postMessage(event.data, '*')
5+
}
6+
})

public/background.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
/*chrome.browserAction.onClicked.addListener(function (tab) {
2-
chrome.tabs.create({ url: "chrome://newtab" });
3-
}
4-
);*/
5-
61
const uninstallUrl = `https://hackertab.dev/uninstall.html`
72
if (chrome.runtime.setUninstallURL) {
83
chrome.runtime.setUninstallURL(uninstallUrl)
9-
}
4+
}

public/base.manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
{
2+
"manifest_version": 3,
23
"name": "Hackertab.dev - developer news",
34
"description": "All developer news in one tab",
45
"version": "1.22.0",
56
"chrome_url_overrides": {
67
"newtab": "index.html"
78
},
9+
"host_permissions": ["https://*.hackertab.dev/*"],
10+
"content_scripts": [
11+
{
12+
"matches": ["https://hackertab.dev/*"],
13+
"run_at": "document_start",
14+
"js": ["content.js"]
15+
}
16+
],
817
"icons": {
918
"16": "/logos/logo16.png",
1019
"32": "/logos/logo32.png",

public/chrome.manifest.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"manifest_version": 3,
32
"background": {
43
"service_worker": "background.js"
5-
},
6-
"host_permissions": ["https://*.hackertab.dev/*"]
4+
}
75
}

public/content.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const script = document.createElement('script')
2+
script.src = chrome.runtime.getURL('auth.js')
3+
document.documentElement.appendChild(script)
4+
5+
// Listen for messages from the injected script
6+
window.addEventListener('message', (event) => {
7+
if (event.source !== window || !event.data || event.data.type !== 'TOKEN_RECEIVED') {
8+
return
9+
}
10+
11+
chrome.runtime.sendMessage({ ...event.data })
12+
})

public/firefox.manifest.json

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{
2-
"manifest_version": 2,
3-
"background": {
4-
"scripts": [
5-
"background.js"
6-
]
7-
},
8-
"permissions": [
9-
"https://*.hackertab.dev/*"
10-
],
11-
"content_security_policy": "script-src 'self' object-src 'self'",
12-
"applications": {
13-
"gecko": {
14-
"id": "{f8793186-e9da-4332-aa1e-dc3d9f7bb04c}"
15-
}
16-
}
17-
}
2+
"background": {
3+
"scripts": ["background.js"]
4+
}
5+
}

src/App.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { useEffect, useLayoutEffect, useState } from 'react'
22
import { DNDLayout } from 'src/components/Layout'
3-
import { setupAnalytics, setupIdentification, trackPageView } from 'src/lib/analytics'
3+
import {
4+
identifyAdvBlocked,
5+
setupAnalytics,
6+
setupIdentification,
7+
trackPageView,
8+
} from 'src/lib/analytics'
49
import { useUserPreferences } from 'src/stores/preferences'
510
import { AppContentLayout } from './components/Layout'
11+
import { verifyAdvStatus } from './features/adv/utils/status'
612
import { isWebOrExtensionVersion } from './utils/Environment'
713
import { lazyImport } from './utils/lazyImport'
814
const { OnboardingModal } = lazyImport(() => import('src/features/onboarding'), 'OnboardingModal')
@@ -30,6 +36,11 @@ export const App = () => {
3036
document.body.classList.remove('preload')
3137
setupAnalytics()
3238
setupIdentification()
39+
const adVerifier = async () => {
40+
const status = await verifyAdvStatus()
41+
identifyAdvBlocked(status)
42+
}
43+
adVerifier()
3344
}, [])
3445

3546
useEffect(() => {

0 commit comments

Comments
 (0)