Skip to content

Commit 3b9e0b0

Browse files
authored
1.7.0
# Features * JP locale * New drop overlay * Help tips are now point at buttons * Updated Readme # Deprecations Custom profiles are no longer supported. Settings block is hidden in current version if matcher is default. Documentation removed.
1 parent 637024d commit 3b9e0b0

16 files changed

+304
-108
lines changed

CUSTOM_PROFILES.md

-13
This file was deleted.

LOCAL_DEVELOPMENT.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
## 🏗️ Building
44

5-
1. Clone `git clone [email protected]:Artboomy/netlogs.git`
5+
1. Install node v16.20.2. Newer versions crash the building process.
6+
2. Clone `git clone [email protected]:Artboomy/netlogs.git`
67

7-
2. Install dependencies `cd netlogs && yarn`
8+
3. Install dependencies `cd netlogs && yarn`
89

9-
3. Build `yarn run build`
10+
4. Build `yarn run build`
1011

11-
4. Enable developer mode in browser at chrome://extensions/ and click **"Load unpacked"** from `dist` folder.
12+
5. Enable developer mode in browser at chrome://extensions/ and click **"Load unpacked"** from `dist` folder.
1213

13-
5. You are ready to go! If you don't see the tab in devtools - just reopen it.
14+
6. You are ready to go! If you don't see the tab in devtools - just reopen it.
1415

15-
6. You can run `yarn run build:watch` for active development.
16+
7. You can run `yarn run build:watch` for active development.
1617
_Hot reload won't work, you'll need to manually reopen devtools on every change._
18+
8. Sometimes pressing the "Reload extension" is needed. Usually when modifying background script.
1719

1820
## 📦 Packaging
1921

README.md

+12-20
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
[Install for Chrome/Edge](https://chrome.google.com/webstore/detail/net-logs/cjdmhjppaehhblekcplokfdhikmalnaf)
99

10-
This is extendable network request viewer extension for Chromium-based browsers.
10+
This is a more high-level version of a Network tab for easier debugging.
1111

1212
## 💡 Features
1313

@@ -16,7 +16,7 @@ The extension will appear in devtools as a `📜 Net logs` tab.
1616
* 🔍 **Advanced Search**: Filter requests by URL and search within parameters/results.
1717
* ⛰️ **Framework Integration**: View Next.js & NuxtJS hydration state.
1818
* 🎨 **Protocol Presets**: Streamlined unpacking for GraphQL and JSON-RPC.
19-
* 🛠️ **Customization**: Modify request names, parameters, and responses with JavaScript.
19+
* 📡 **WebSocket Listening**: Capture and analyze WebSocket traffic in real-time.
2020
***Log Viewing**: Analyze live or import logs from HAR/*.netlogs.zip files.
2121
* 🤝 **Collaboration**: Export and share logs for team debugging.
2222

@@ -45,10 +45,6 @@ Features: method extraction, result unwrapping, coloring for error responses.
4545

4646
![json-rpc.png](./img/json-rpc.png)
4747

48-
### Custom profiles
49-
50-
If you need custom request/response processing, please refer to the [documentation](CUSTOM_PROFILES.md).
51-
5248
## ⛰️ [Next.js](https://nextjs.org/) and [NuxtJS](https://nuxtjs.org/) debugging
5349

5450
![next.png](./img/next.png)
@@ -139,34 +135,30 @@ page**.
139135
140136
## 🐜Troubleshooting
141137
142-
If something goes wrong and functions crash the view, do the following:
143-
144-
1. [Export a *.har log](https://developer.chrome.com/docs/devtools/network/reference/#save-as-har) from network tab
145-
2. Open options page
146-
3. Drop exported log in the interactive demo
147-
4. Open console
148-
149-
You should see the errors in the console.
138+
If something goes wrong:
150139
151-
Alternatively, you can open a devtools on the devtools. To do so, undock the devtools and press `Ctrl+Shift+J`, or press
152-
right-click and choose `Inpsect`.
140+
1. Reopen the devtools
141+
2. Try to fully close and open browser
153142
154-
This will open new debugger window, where you can find console log with errors.
143+
If the issue persist -
144+
please [open new bug report](https://github.com/Artboomy/netlogs/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=%5BBUG%5D).
145+
Make sure to include *.har file if possible.
155146
156147
## 🔐 Security & privacy
157148
158-
All your custom javascript runs in
149+
Extension panel runs in
159150
a [sandbox environment](https://developer.chrome.com/docs/extensions/mv2/manifest/sandbox/).
160151
161-
Extension does not transmit any data to the servers.
152+
Extension collects anonymous analytics with Google Analytics 4. You can opt out in the Options.
162153
163154
All settings are stored locally.
164155
165156
## 🤝 Permissions
166157
167158
* `storage` - used to store your custom settings. Does not sync.
168-
* `content_scripts` - used to extract Nextjs/Nuxtjs data from page.
159+
* `content_scripts` - used to extract NextJS/NuxtJS data from page.
169160
* `contextMenus` - used to extract selected text for search
161+
* `debugger` - used for WebSocket listening.
170162
171163
The list may extend in the future.
172164

dist/_locales/ja/messages.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"searchIn": {
3+
"message": "Netlogsで検索"
4+
}
5+
}

dist/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Net logs",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"default_locale": "en",
55
"manifest_version": 3,
66
"minimum_chrome_version": "88",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netlogs",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"description": "Web extension for custom network logs representation",
55
"main": "index.js",
66
"author": "artboomy",

src/api/runtime.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class SandboxRuntime {
55
return {
66
manifest_version: 3,
77
name: 'Net logs',
8-
version: '1.6.0'
8+
version: '1.7.0'
99
};
1010
}
1111

src/app/panel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wrapSandbox } from '../sandboxUtils';
1+
import { wrapSandbox } from 'sandboxUtils';
22
import { createEventPayload, isExtension, postSandbox } from '../utils';
33
import analytics from '../api/analytics';
44
import Port = chrome.runtime.Port;

src/app/sandboxSettings.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { ListDemo } from '../components/list/Demo';
4-
import { callParent } from '../utils';
5-
import { SettingsContainer } from '../components/SettingsContainer';
3+
import { ListDemo } from 'components/list/Demo';
4+
import { callParent } from 'utils';
5+
import { SettingsContainer } from 'components/SettingsContainer';
6+
import { ThemeProvider } from 'react-jss';
7+
import { theme } from 'theme/light';
68

79
const SandboxListDemo = () => {
810
return (
911
<SettingsContainer>
10-
<ListDemo />
12+
<ThemeProvider theme={theme}>
13+
<ListDemo />
14+
</ThemeProvider>
1115
</SettingsContainer>
1216
);
1317
};

src/components/IconButton.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,6 @@ export const ICONS: Record<string, IconButtonProps['icon']> = {
9494
panelUp: '136px -72px',
9595
debugOff: '-172px 264px',
9696
debugOn: '-88px 24px',
97-
inspect: '136px -72px'
97+
inspect: '136px -72px',
98+
drop: '52px -72px'
9899
} as const;

src/components/Options.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ const useStyles = createUseStyles<Theme>((theme) => ({
100100
profilesBlock: {
101101
height: '100%'
102102
},
103+
hidden: {
104+
display: 'none'
105+
},
103106
titleRow: {
104107
display: 'flex',
105108
alignItems: 'baseline',
@@ -163,6 +166,7 @@ export const Options: FC = () => {
163166
const [matcher, setMatcher] = useState<ISettingsSerialized['matcher']>(
164167
settings.matcher.toString()
165168
);
169+
const isDefaultMatcher = Object.keys(settings.profiles).length === 3;
166170

167171
useEffect(() => {
168172
const newFunctions = Object.assign(
@@ -282,6 +286,7 @@ export const Options: FC = () => {
282286
<option value='es-ES'>Español</option>
283287
<option value='hi'>हिंदी</option>
284288
<option value='zh-CN'>中文</option>
289+
<option value='ja-JP'>日本語</option>
285290
</select>
286291
</section>
287292

@@ -422,7 +427,10 @@ export const Options: FC = () => {
422427
<h2>{i18n.t('hiddenTags')}</h2>
423428
<HiddenTagList />
424429
</section>
425-
<section className={cn(styles.block, styles.profilesBlock)}>
430+
<section
431+
className={cn(styles.block, styles.profilesBlock, {
432+
[styles.hidden]: isDefaultMatcher
433+
})}>
426434
<h2>{i18n.t('profiles')}</h2>
427435
<section className={styles.root}>
428436
<div className={styles.left}>

src/components/PanelMain.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import useDebounce from 'react-use/lib/useDebounce';
1212
import { Footer } from './Footer';
1313
import { FilterContext } from 'context/FilterContext';
1414
import { useHotkey } from 'hooks/useHotkey';
15-
import { ToastContainer } from 'react-toastify';
15+
import { toast, ToastContainer } from 'react-toastify';
1616
import 'react-toastify/dist/ReactToastify.min.css';
17-
import { callParentVoid, subscribeParent } from 'utils';
17+
import { callParent, callParentVoid, subscribeParent } from 'utils';
1818
import { Theme } from 'theme/types';
1919
import { useSettings } from 'hooks/useSettings';
2020

@@ -96,7 +96,16 @@ export const PanelMain: React.FC = () => {
9696
}, [language]);
9797
*/
9898
useEffect(() => {
99-
callParentVoid('analytics.init');
99+
callParent('analytics.init').then((isDefault) => {
100+
if (isDefault !== 'true') {
101+
toast.warning(
102+
'Custom profiles support is DEPRECATED and will be REMOVED in the next version',
103+
{
104+
autoClose: false
105+
}
106+
);
107+
}
108+
});
100109
}, []);
101110

102111
useEffect(() => {

src/components/list/DropContainer.tsx

+40-13
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,54 @@
11
import React, { FC } from 'react';
2-
import { useListStore } from '../../controllers/network';
2+
import { useListStore } from 'controllers/network';
33
import { useDrop } from 'react-dnd';
44
import { NativeTypes } from 'react-dnd-html5-backend';
5-
import { isFileSupported, parseFile } from '../../controllers/file';
5+
import { isFileSupported, parseFile } from 'controllers/file';
66
import { Har } from 'har-format';
77
import NetworkItem from '../../models/NetworkItem';
88
import cn from 'classnames';
99
import { createUseStyles } from 'react-jss';
1010
import ContentOnlyItem from '../../models/ContentOnlyItem';
11-
import { ItemType } from '../../models/types';
11+
import { ItemType } from 'models/types';
1212
import TransactionItem from '../../models/TransactionItem';
1313
import { toast } from 'react-toastify';
14-
import { callParentVoid } from '../../utils';
14+
import { callParentVoid } from 'utils';
1515
import WebSocketItem from '../../models/WebSocketItem';
16-
import { i18n } from '../../translations/i18n';
16+
import { i18n } from 'translations/i18n';
17+
import largeIcons from 'icons/largeIcons.svg';
18+
import { ICONS } from 'components/IconButton';
19+
import { Theme } from 'theme/types';
1720

18-
const useStyles = createUseStyles({
21+
const useStyles = createUseStyles<Theme>((theme) => ({
1922
dropZone: {
2023
height: '100%',
2124
width: '100%',
2225
boxSizing: 'border-box',
23-
overflow: 'auto',
24-
border: '4px solid transparent'
26+
overflow: 'auto'
2527
},
26-
dropZoneActive: {
27-
border: '4px dashed #ccc'
28+
overlay: {
29+
backgroundColor: 'rgba(0, 0, 0, 0.1)',
30+
position: 'fixed',
31+
top: 0,
32+
bottom: 0,
33+
left: 0,
34+
right: 0,
35+
display: 'flex',
36+
flexDirection: 'column',
37+
justifyContent: 'center',
38+
alignItems: 'center',
39+
fontSize: '2em',
40+
backdropFilter: 'blur(2px)'
41+
},
42+
icon: {
43+
backgroundColor: theme.icon.normal,
44+
width: '21px',
45+
height: '24px',
46+
scale: 3,
47+
transform: 'translateY(-4px)',
48+
'-webkit-mask-position': ICONS.drop as `${number}px ${number}px`,
49+
'-webkit-mask-image': `url(${largeIcons})`
2850
}
29-
});
51+
}));
3052

3153
export const DropContainer: FC = ({ children }) => {
3254
const styles = useStyles();
@@ -105,10 +127,15 @@ export const DropContainer: FC = ({ children }) => {
105127
<div
106128
ref={dropRef}
107129
className={cn({
108-
[styles.dropZone]: true,
109-
[styles.dropZoneActive]: canDrop && isOver
130+
[styles.dropZone]: true
110131
})}>
111132
{children}
133+
{canDrop && isOver && (
134+
<div className={styles.overlay}>
135+
<div className={styles.icon} />
136+
{i18n.t('drop')}
137+
</div>
138+
)}
112139
</div>
113140
);
114141
};

0 commit comments

Comments
 (0)