Skip to content

Commit

Permalink
chore(network): disable throttling, blocked urls/cookies, and custom …
Browse files Browse the repository at this point in the history
…header config
  • Loading branch information
byCedric committed Dec 4, 2023
1 parent 3d5f69f commit e3d6b25
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
15 changes: 9 additions & 6 deletions front_end/panels/network/NetworkLogView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,23 +513,26 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
'only-show-issues', i18nString(UIStrings.hasBlockedCookies), true, this.networkShowIssuesOnlySetting);
this.onlyIssuesFilterUI.addEventListener(
UI.FilterBar.FilterUIEvents.FilterChanged, this.filterChanged.bind(this), this);
UI.Tooltip.Tooltip.install(this.onlyIssuesFilterUI.element(), i18nString(UIStrings.onlyShowRequestsWithBlocked));
filterBar.addFilter(this.onlyIssuesFilterUI);
// NOTE(bycedric): disabled due to missing native implementation
// UI.Tooltip.Tooltip.install(this.onlyIssuesFilterUI.element(), i18nString(UIStrings.onlyShowRequestsWithBlocked));
// filterBar.addFilter(this.onlyIssuesFilterUI);

this.onlyBlockedRequestsUI = new UI.FilterBar.CheckboxFilterUI(
'only-show-blocked-requests', i18nString(UIStrings.blockedRequests), true,
this.networkOnlyBlockedRequestsSetting);
this.onlyBlockedRequestsUI.addEventListener(
UI.FilterBar.FilterUIEvents.FilterChanged, this.filterChanged.bind(this), this);
UI.Tooltip.Tooltip.install(this.onlyBlockedRequestsUI.element(), i18nString(UIStrings.onlyShowBlockedRequests));
filterBar.addFilter(this.onlyBlockedRequestsUI);
// NOTE(bycedric): disabled due to missing native implementation
// UI.Tooltip.Tooltip.install(this.onlyBlockedRequestsUI.element(), i18nString(UIStrings.onlyShowBlockedRequests));
// filterBar.addFilter(this.onlyBlockedRequestsUI);

this.onlyThirdPartyFilterUI = new UI.FilterBar.CheckboxFilterUI(
'only-show-third-party', i18nString(UIStrings.thirdParty), true, this.networkOnlyThirdPartySetting);
this.onlyThirdPartyFilterUI.addEventListener(
UI.FilterBar.FilterUIEvents.FilterChanged, this.filterChanged.bind(this), this);
UI.Tooltip.Tooltip.install(this.onlyThirdPartyFilterUI.element(), i18nString(UIStrings.onlyShowThirdPartyRequests));
filterBar.addFilter(this.onlyThirdPartyFilterUI);
// NOTE(bycedric): disabled due to missing native implementation
// UI.Tooltip.Tooltip.install(this.onlyThirdPartyFilterUI.element(), i18nString(UIStrings.onlyShowThirdPartyRequests));
// filterBar.addFilter(this.onlyThirdPartyFilterUI);

this.filterParser = new TextUtils.TextUtils.FilterParser(searchKeys);
this.suggestionBuilder =
Expand Down
54 changes: 28 additions & 26 deletions front_end/panels/network/NetworkPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,32 +415,34 @@ export class NetworkPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
this.panelToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingCheckbox(
this.preserveLogSetting, i18nString(UIStrings.doNotClearLogOnPageReload), i18nString(UIStrings.preserveLog)));

this.panelToolbar.appendSeparator();
const disableCacheCheckbox = new UI.Toolbar.ToolbarSettingCheckbox(
Common.Settings.Settings.instance().moduleSetting('cacheDisabled'),
i18nString(UIStrings.disableCacheWhileDevtoolsIsOpen), i18nString(UIStrings.disableCache));
this.panelToolbar.appendToolbarItem(disableCacheCheckbox);

this.panelToolbar.appendToolbarItem(this.throttlingSelect);

const networkConditionsIcon = new IconButton.Icon.Icon();
networkConditionsIcon.data = {
iconName: 'network-settings',
color: 'var(--icon-default)',
width: '20px',
height: '20px',
};
const networkConditionsButton =
new UI.Toolbar.ToolbarButton(i18nString(UIStrings.moreNetworkConditions), networkConditionsIcon);
networkConditionsButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {
void UI.ViewManager.ViewManager.instance().showView('network.config');
}, this);
this.panelToolbar.appendToolbarItem(networkConditionsButton);

this.rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarItem(this.progressBarContainer));
this.rightToolbar.appendSeparator();
this.rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingToggle(
this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.networkSettings), 'gear-filled'));
// NOTE(bycedric): disabled due to missing native implementation

// this.panelToolbar.appendSeparator();
// const disableCacheCheckbox = new UI.Toolbar.ToolbarSettingCheckbox(
// Common.Settings.Settings.instance().moduleSetting('cacheDisabled'),
// i18nString(UIStrings.disableCacheWhileDevtoolsIsOpen), i18nString(UIStrings.disableCache));
// this.panelToolbar.appendToolbarItem(disableCacheCheckbox);

// this.panelToolbar.appendToolbarItem(this.throttlingSelect);

// const networkConditionsIcon = new IconButton.Icon.Icon();
// networkConditionsIcon.data = {
// iconName: 'network-settings',
// color: 'var(--icon-default)',
// width: '20px',
// height: '20px',
// };
// const networkConditionsButton =
// new UI.Toolbar.ToolbarButton(i18nString(UIStrings.moreNetworkConditions), networkConditionsIcon);
// networkConditionsButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {
// void UI.ViewManager.ViewManager.instance().showView('network.config');
// }, this);
// this.panelToolbar.appendToolbarItem(networkConditionsButton);

// this.rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarItem(this.progressBarContainer));
// this.rightToolbar.appendSeparator();
// this.rightToolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingToggle(
// this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.networkSettings), 'gear-filled'));

const settingsToolbarLeft = new UI.Toolbar.Toolbar('', this.settingsPane.element);
settingsToolbarLeft.makeVertical();
Expand Down

0 comments on commit e3d6b25

Please sign in to comment.