Opened 3 years ago

Closed 3 years ago

#5060 closed change (fixed)

Move module code from adblockpluschrome/lib/compat.js into the modules template

Reported by: kzar Assignee: kzar
Priority: P2 Milestone:
Module: Automation Keywords:
Cc: sebastian Blocked By:
Blocking: #5077 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kzar)


For #4864 we're making changes to adblockpluschrome so that it validates using ESLint. One rule we have there is no-undef which gives an error for any global variables which haven't been declared in the file.

Therefore we want to reduce the number of these global variables which are declared in one file but then used in another. We want to do this by breaking the code down into proper modules where possible.

In adblockpluschrome/lib/compat.js there is a section titled "Module framework stuff" which contains the code we use to make modules work. So far that is only available from the background context, so we want to move that to somewhere which can be used from the page context too.

What to change

  • Take the "Module framework stuff" section from adblockpluschrome/lib/compat.js and move it into buildtools/templates/modules.js.tmpl.
  • Turn info into a proper module, which is injected only when available and when the "modules" argument is set.

Integration notes

For adblockpluschrome some changes will be required:

  • The "Module framework stuff" section in adblockpluschrome/lib/compat.js will need to be removed.
  • /lib/info.js will need to be removed from metdatadata.common.

Change History (5)

comment:1 Changed 3 years ago by kzar

  • Blocking 4864 removed
  • Description modified (diff)

comment:2 Changed 3 years ago by kzar

  • Blocking 5077 added

comment:3 Changed 3 years ago by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 3 years ago by abpbot

comment:5 Changed 3 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.