Closed Bug 1500895 Opened 6 years ago Closed 5 years ago

Contribute button on add-on details page doesn't work

Categories

(Thunderbird :: Add-Ons: General, defect)

58 Branch
Unspecified
All
defect
Not set
normal

Tracking

(thunderbird_esr6868+ fixed)

RESOLVED FIXED
Thunderbird 68.0
Tracking Status
thunderbird_esr68 68+ fixed

People

(Reporter: nONoNonO, Assigned: jorgk-bmo)

References

Details

(Keywords: regression)

Attachments

(2 files)

Add-on developers have an option to specify a contributions URL for users to make a donation. This URL is added to the details page of the add-on. When you click this Contribute button in Thunderbird, nothing happens. Expected results: The URL specified on addons.thunderbird.net should open in a tab. Actual results: The following error appears in the errorconsole: NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative contentAreaUtils.js:1230 openURL chrome://global/content/contentAreaUtils.js:1230:7 doCommand chrome://mozapps/content/extensions/extensions.js:1398:9 doCommand chrome://mozapps/content/extensions/extensions.js:1524:5 initialize/< chrome://mozapps/content/extensions/extensions.js:132:5 Note: if you flip network.protocol-handler.expose.http and/or network.protocol-handler.expose.https to false, the contritions URL is opened correctly in your browser.
Maybe Andrei might want to look into this one.
Flags: needinfo?(sancus)
See Also: → 428602

I did some testing with mozregression-qui and found this regression range:
comm-central 58.0a1
Last known good: 20170924030211 (platform_changeset: ff40c5dcaa41261b39a4e9795e02a9d51dd30ced)
First known bad: 20170925030209 (platform_changeset: 5f3f19824efa14cc6db546baf59c54a0fc15ddc9)

So it's been broken for quite some time now, which might explain that I hardly ever get any donations anymore :~(

Strange thing is that when it worked, it always opened the URL in the browser, regardless of the setting of network.protocol-handler.expose.https.

Keywords: regression

This might be an easier fix for people who are working on TB regularly, but I haven't touched the client in a couple of months and am currently buried in website/atn/telemetry work, so I don't have any plans to look at this right now.

Flags: needinfo?(sancus)

the contribute button now works with Thunderbird Daily (but still not with Thunderbird 68.0b4)

Clicking on the "Contribute" button gives this in the console:

NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative contentAreaUtils.js:1226
openURL chrome://global/content/contentAreaUtils.js:1226
doCommand chrome://mozapps/content/extensions/extensions.js:1374
doCommand chrome://mozapps/content/extensions/extensions.js:1489
initialize chrome://mozapps/content/extensions/extensions.js:123

The offending code is this:

    if (channel) {
      channel.channelIsForDownload = true;
    }

Yes, that was added in bug 1360603, https://hg.mozilla.org/mozilla-central/rev/6d7610f4d26d#l1.12, I'll just see what happens if we remove those three lines. Not so easy to do, since it works in Daily, so I'd have to do it on the TB 68 try build.

It was most likely fixed when the entire add-ons manager was replaced in FF in bug 1555012 and TB followed in bug 1565180.

Aryx, can you explain to me how you modified a file in omni.ja in bug 1567783 comment #5. I'd like to do this here. I know that you can unpack it and then remove it and TB runs on the unpacked files, but I was never able to modify the content.

Flags: needinfo?(aryx.bugmail)

Well, if removing those three lines helps, I'll do it for TB 68.

OK, I followed https://www.raymond.cc/blog/edit-files-inside-firefox-4-omni-jar-to-auto-save-password/
Basically downloaded optimizejars.py, copied TB's omni.ja to omni.jar in a temp directory, python optimizejars.py --deoptimize ./ ./ ./t where t was another temp directory. The resulting omni.jar could be edited in 7zip and the modification written back to the archive. Optimise again python optimizejars.py --optimize ./ ./t ./tt and copy the result back to the TB program directory as omni.ja. And the result: Ta-dah, TB crashed when launched :-(

Hmm, this comment got lost somehow:

Aryx, can you explain to me how you modified a file in omni.ja like you said in bug 1567783 comment #5. I know that you can unpack it and then remove it and TB runs on the unpacked files, but I was never able to modify the content (last failed attempt in comment #13 above).

OK, I did the unpack trick and modified: chrome\toolkit\content\global\contentAreaUtils.js:1226
After that the links work. I'll fix it via a backout of that patch in the final release.

Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Target Milestone: --- → Thunderbird 68.0
Version: unspecified → 68

How I do it:

  1. Copy the install directory.
  2. Unzip the omni.ja with 7-Zip (recent versions support the omni.ja), ignore the warning.
  3. Find the file you want to modify.
  4. Edit it and save it.
  5. Select all files.
  6. Create a zip file (format zip, compression deflate) and name it omni.ja
  7. Replace the omni.ja in the application directory with the one you created.
  8. Launch the application, e.g. with thunderbird.exe -no-remote -P "Coding-central" -purgecaches
OS: Unspecified → All

TB 68.0 ESR, fixed via backout:

https://hg.mozilla.org/releases/mozilla-esr68/rev/2f459603370d1d35a56ca4e9cee21f7766bbb832 on THUNDERBIRD_68_VERBRANCH
Backed out changeset 6d7610f4d26d (bug 1360603 for causing bug 1500895) to build Thunderbird 68.0. a=jorgk DONTBUILD

Thanks for your answer, Aryx.

Flags: needinfo?(aryx.bugmail)

This is working now. Windows build here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=4a0e4fac7b7fe74c070d6f9d00294e02bc4e5382
You can install it by clicking onto the "B" and under "Job Details" getting target.zip or target.installer.exe.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

Broken for a long time.

Version: 68 → 58 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: