Add manual check before starting mutationObserver

Sometimes, when starting the mutationObserver, watched nodes have
already been added and are therefore not detected.

This change is a follow-up change to change
https://gerrit.avm99963.com/c/infinitegforums/+/1041 which fixes the
same thing for the mutationObserver at
//src/content_scripts/console_inject.js.

Bug: #21
Change-Id: I6ea3308abc10a66ef4dd2572f9e40cab9d6e4d7b
1 file changed
tree: 7f683fa41bd9ed99c33a1c2496088216f7406a91
  1. .github/
  2. docs/
  3. src/
  4. templates/
  5. testdata/
  6. .clang-format
  7. .editorconfig
  8. .gitignore
  9. .gitreview
  10. generateManifest.go
  11. generateManifest_test.go
  12. LICENSE
  13. Makefile
  14. OWNERS
  15. README.md
  16. release.bash
  17. tagRelease.bash
README.md

TW Power Tools

Available in the Chrome Web Store

An extension which brings several enhancements to the Google Forums and the Community Console.

Release cycle

When the code in the master branch is considered to be stable, a release can be made. This is the procedure:

  1. Tag the last commit with a version number (in the format vx, where x is the extension's version number for that release) by running bash tagRelease.bash --version vx. Note that the tag must be pushed to Gerrit after being created.
  2. Build the extension for both the stable and beta channels (this is explained in the next section). This will output a ZIP file for each release channel and each supported browser.

Afterwards, the release/build files must be submitted to the Chrome Web Store and addons.mozilla.org.

Submitting to the Chrome Web Store

  1. Upload both release files to the Chrome Web Store, one for each release channel.
  2. Submit both releases to be reviewed by the Chrome Web Store team, but in the case of the stable channel uncheck the "Publish automatically after it has passed review" option.
  3. Upload the beta release file to the GitHub releases page under the newly created tag. Mark that release as a pre-release at GitHub.
  4. Wait until the beta release is reviewed and approved by Google.
  5. Test again the extension by using the beta channel. Check if the options have been transfered correctly from version to version, and wait some days (for instance between 3 and 5 days) to see if other people report issues with the updated version.
  6. If everything goes well, publish the update in the stable channel. The updated version should have already been reviewed by the Chrome Web Store team at this time.
  7. Update the release file in the GitHub releases page by removing the beta release file and uploading the stable release file. Also, remove the pre-release label.

If during this process the release wasn't approved by Google or an issue was found during beta testing, a new release which fixes this should be created.

Submitting to addons.mozilla.org

The procedure is similar to the one with the Chrome Web Store.

@TODO: Add more details once the first version of the extension has been uploaded to addons.mozilla.org.

Build the extension

A zip file with the contents of the extension, which can be uploaded to the Chrome Web Store and addons.mozilla.org, can be created with any of the following procedures (make sure to install Go before building the extension, as it is needed during the build):

Using the release.bash script

Run bash release.bash -h in order to learn how to use this command. To summarize, the command accepts the --channel and --browser flags (or their short versions -c and -b).

As an example, if you wanted to create a ZIP file of the beta-branded extension targeted for Firefox, you would run bash release.bash -c beta -b gecko.

Using make

You can also use make to build the extension. This is just a wrapper for the release.bash command.

Run make all to build the extension for all the available channels and browsers. You can also run make {target} where {target} is one of the following: chromium-stable, chromium-beta, chromium-mv3-beta, gecko-stable.

Run make clean to clean all the release files (this removes the out folder, which is where the release files are saved).

Testing notes

When testing the extension during development, you don't have to build the extension each time you want to import an updated version to Chrome/Firefox. Instead, run go run generateManifest.go {browser} once, where {browser} is CHROMIUM, GECKO or CHROMIUM_MV3, and this will generate a manifest.json file for the specified browser in the src directory. Now, you can load the src folder directly in the browser in order to import the extension, which removes the need to build it. When the manifest.gjson file is modified, you'll have to generate the manifest again.

To test translations, you might want to set your browser's locale. This section tells you how to set the locale in Windows, Mac OS X, Linux, and Chrome OS.

Beta channel

The beta channel for Chrome is available here.