Skip to content

Commit

Permalink
AG-8562 clean up filtering events
Browse files Browse the repository at this point in the history
Merge in EXTENSIONS/browser-extension from fix/AG-8562 to feature/AG-2737

* commit 'e2d55052702fed977e49ad97567699cc8b61694d':
  revert no default value and fix jsdoc for clearEventsByTabId param ignorePreserveLog
  no extra requestContextStorage.record for DOCUMENT-type requests
  clean up
  ditch SHOULD_CLEAR_EMPTY_EVENTS
  clean up comment
  rename sortedPreviousEvents to filteredPreviousEvents
  clean up comments
  add clearOnlyEmpty flag for clearEventsByTabId for wiping empty events
  clean up empty events while pushFilteringEvent
  clean up
  filter events for tab
  • Loading branch information
slavaleleka committed Jun 21, 2021
2 parents 8eb2d9f + e2d5505 commit 34fa747
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with Adguard Browser Extension. If not, see <http://www.gnu.org/licenses/>.
*/


/**
* This is an abstract filtering log module with methods throwing errors if used.
* It should be replaced by webpack during compilation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ const browsersFilteringLog = (function () {

/**
* Remove log requests for tab
* @param tabId
* @param {boolean} ignorePreserveLog
* @param {number} tabId
* @param {boolean} [ignorePreserveLog]
*/
const clearEventsByTabId = function (tabId, ignorePreserveLog) {
const tabInfo = tabsInfoMap[tabId];
Expand Down
8 changes: 4 additions & 4 deletions Extension/src/background/filter/request-blocking.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const webRequestService = (function () {
referrerUrl,
requestType,
tab,
requestRule
requestRule,
});

return isRequestBlockedByRule(requestRule);
Expand Down Expand Up @@ -449,9 +449,9 @@ export const webRequestService = (function () {
const ruleResult = r.getAdvancedModifier().removeParameters(result);
if (ruleResult !== result) {
filteringLog.addRemoveParamEvent({
tab,
frameUrl: requestUrl,
requestType,
tab,
frameUrl: requestUrl,
requestType,
rule: r,
timestamp: Date.now(),
});
Expand Down
12 changes: 0 additions & 12 deletions Extension/src/background/webrequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ const webrequestInit = function () {
// Reset tab button state
listeners.notifyListeners(listeners.UPDATE_TAB_BUTTON_STATE, tab, true);

// Record request context for the main frame
requestContextStorage.record({
requestId,
requestUrl,
referrerUrl: requestUrl,
originUrl,
requestType,
tab,
method,
});

/**
* Just to remember!
* In the case of the "about:newtab" pages we don't receive onResponseReceived event for the main_frame
Expand Down Expand Up @@ -517,7 +506,6 @@ const webrequestInit = function () {
const requestContext = requestContextStorage.get(requestId);
if (!requestContext) {
// Record request for other types
//const { requestId, requestUrl, referrerUrl, originUrl, requestType, tab } = params;
requestContextStorage.record({
requestId,
requestUrl,
Expand Down

0 comments on commit 34fa747

Please sign in to comment.