Closed Bug 1589758 Opened 6 years ago Closed 5 years ago

"Cannot send function call result" when using "origin" in "permissions.request"

Categories

(WebExtensions :: Request Handling, defect, P3)

69 Branch
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: Manuel.Spam, Unassigned)

Details

Attachments

(1 file)

14.46 KB, application/x-xpinstall
Details
Attached file test.xpi

If I try to use "origin" in "permissions.request", then I get the following on Browser Console:

Cannot send function call result: other side closed connection (call data: ({path:"permissions.request", args:[{origins:["https://aaaaaa/"], permissions:["webRequest"]}]}))

I'll attach a start of an Addon I wanted to create as a test case. It is still very basic anyway.

Install it. Open Addon settings. Enter an URL (with http...) in the text box, click "Add".
If adding the permission succeeds, the idea was to add the result to the list below the input box. This doesn't happen as the exception about "not being able to send result" prevents any further code execution.

Version: Firefox 69 → 69 Branch

The priority flag is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Priority: -- → P3

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Request Handling

This is a bug in your extension. Upon clicking the button, the form is submitted, which causes the options page to unload. The original script won't be running any more, hence the "other side closed connection" error.

It could have been nice to remove the prompt upon close, but that's not what this bug is about.

To fix your add-on, call event.preventDefault(); from the click handler.

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

Attachment

General

Creator:
Created:
Updated:
Size: