Closed Bug 1679849 Opened 5 years ago Closed 5 years ago

Cannot modify properties of a WrappedNative

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bege10, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

I use Javascript scripts (chrome folder in user profile) and this line works in Firefox

openURL(addon.homepageURL)

but throws an exception in Thunderbird

Actual results:

Instead of opening the homepage URL of an extension nothing happens at all and this message is in error console

Uncaught
Exception { name: "NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN", message: "Cannot modify properties of a WrappedNative", result: 2153185332, filename: "chrome://global/content/contentAreaUtils.js", lineNumber: 1322, columnNumber: 0, data: null, stack: "openURL@chrome://global/content/contentAreaUtils.js:1322:7\nhandleClick@file:///F:/Users/bege/AppData/Roaming/Thunderbird/Profiles/plhihngc.default/chrome/JS/ExtensionOptionsMenu+TB.uc.js:338:13\npopulateMenu/</<@file:///F:/Users/bege/AppData/Roaming/Thunderbird/Profiles/plhihngc.default/chrome/JS/ExtensionOptionsMenu+TB.uc.js:258:50\n", location: XPCWrappedNative_NoHelper }
contentAreaUtils.js:1322

Expected results:

Opening the homepage URL of an extension

This is the same as in the fixed bug 1500895

Is the bug back in TB 78 or is this a different issue?

Component: Untriaged → Add-Ons: Extensions API

Can you try to use this function (copy-paste it into your add-on/userscript) to open a URL in an external Browser:
https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-windows.js#341-356

That is what is used behind the scenes when WebExtensions want to open external pages.

(In reply to John Bieling (:TbSync) from comment #1)

Can you try to use this function (copy-paste it into your add-on/userscript) to open a URL in an external Browser:
https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-windows.js#341-356

That is what is used behind the scenes when WebExtensions want to open external pages.

It works :thumbsup: Thank you very much :smiley:
Is "openURL(url)" obsolete and will throw an error in Firefox also sooner or later, or is this an regression in Thunderbird that it doesn't work here but works in Firefox?

I do not know where that function is from. This is not a "regression" in Thunderbird (and actually an invalid bug). Thunderbird has to make sure that Thunderbird itself and its WebExtension APIs work if some things change internally. If an add-on calls arbitrary internal functions which might have been changed/removed, its developer has to update it. In this case, that add-on even allows users to call arbitrary internal functions, so the users have to update their scripts.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Resolution: FIXED → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: