Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background page structuring #171

Merged
merged 18 commits into from
Oct 21, 2019
Merged

Background page structuring #171

merged 18 commits into from
Oct 21, 2019

Conversation

eritbh
Copy link
Member

@eritbh eritbh commented Oct 14, 2019

Fixes #129, partially addresses #44.

TODOs:

  • Split up various concerns in the background page to their own files for organization
  • Rework message format from {action: 'thing', ...options} to ['thing', {options}] to free up the action key for use in handlers
  • Rename message actions to not use the tb- prefix and use a more descriptive convention (needs discussion)
  • chrome.* -> browser.* webextension APIs

@eritbh eritbh added this to the v5.3 milestone Oct 14, 2019
@eritbh eritbh requested a review from creesch October 14, 2019 03:32
@eritbh eritbh self-assigned this Oct 14, 2019
Copy link
Member

@Venefilyn Venefilyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not looked at the differences between background and the new handlers, would've been nicer if the split was done first and then changes made so we can more easily see what's changing

extension/data/background/handlers/cache.js Outdated Show resolved Hide resolved
extension/data/background/handlers/cache.js Show resolved Hide resolved
extension/data/background/handlers/cache.js Show resolved Hide resolved
extension/data/background/handlers/cache.js Show resolved Hide resolved
extension/data/background/handlers/webrequest.js Outdated Show resolved Hide resolved
Copy link
Member

@creesch creesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. I mostly had a general look so far as I understand that this is pretty much a work in progress.

.eslintrc.json Show resolved Hide resolved
extension/data/background/background.js Show resolved Hide resolved
extension/data/background/handlers/globalmessage.js Outdated Show resolved Hide resolved
extension/data/background/handlers/webrequest.js Outdated Show resolved Hide resolved
extension/data/background/handlers/webrequest.js Outdated Show resolved Hide resolved
extension/manifest.json Outdated Show resolved Hide resolved
@eritbh eritbh marked this pull request as ready for review October 21, 2019 00:22
@eritbh eritbh merged commit 434ec0b into master Oct 21, 2019
@eritbh eritbh deleted the background-organization branch October 21, 2019 17:04
@eritbh eritbh modified the milestones: v5.x, v5.3 Mar 10, 2020
eritbh added a commit that referenced this pull request Sep 5, 2024
* Add webextension-polyfill@0.5.0 (background only)

* Convert message listener to browser API + promises

* Add basic message handler logic

* Add no-return-await to eslint

* Use explicit promise returns in message listener

eslint complained about not using `await` and we don't want to return promises if we have no response.

* Split out web request handler

* Split out reload handler

* Split out cache/global, use right polyfill file

* Split out notification handling

* chrome -> browser for most of the background stuff

* Can't be clever about this one...

* ? isn't a thing in jsdoc

Co-Authored-By: Eric <SpyTec@users.noreply.github.com>

* Directory eslint to remove per-file comments

* Un-minify webext-polyfill

* Handle background-bound global events more cleanly

* Apply changes from master, misc. cleanup

* Remove invalid jsdoc tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibly structure background code a bit more.
3 participants