Closed Bug 614613 Opened 14 years ago Closed 14 years ago

the reddit-panel example uses the old Widget API

Categories

(Add-on SDK Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: irakli, Unassigned)

References

Details

Attachments

(1 file)

I just noticed that our reddit-panel example is broken badly for several reasons actually:

1. It uses old widget API.
2. Once first was fixed I discovered another problem with EventEmitter:
https://github.com/Gozala/addon-sdk/blob/master/packages/jetpack-core/lib/events.js#L131
Object.getPrototypeOf returns undefined that is incorrect behavior and issue looks similar to this one https://bugzilla.mozilla.org/show_bug.cgi?id=608959
3. After disabling that line I found different error:

(addon-sdk)➜  reddit-panel  (master) cfx run
Using binary at '/Applications/Firefox.app/Contents/MacOS/firefox-bin'.
Using profile at '/var/folders/-y/-yjxO9IXGGSRN-hSaip1Qk+++TM/-Tmp-/tmpcZz2_X.mozrunner'.
info: [Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: /Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js :: <TOP_LEVEL> :: line 1090"  data: no]
info: TypeError: $(window).click is not a function
error: An exception occurred.
Traceback (most recent call last):
  File "/Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js", line 7180, in null
  File "/Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js", line 913, in null
  File "/Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js", line 1101, in null
  File "/Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js", line 1090, in null
[Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: /Users/gozala/Projects/addon-sdk/examples/reddit-panel/data/jquery-1.4.2.min.js :: <TOP_LEVEL> :: line 1090"  data: no]
error: An exception occurred.

After looking closer at the issue I discovered that following line throws an exception:

var isSupported = (eventName in el);

I also verified that eventName is string and el is a dom element:

console.log(eventName, el)

onsubmit [object XrayWrapper [object HTMLDivElement]] 


Not sure yet what this is but it's clear that exception with message "Component is not available" is not something we should be getting. I'm suspicious that this is compartments related bug.


I also do think this  should be a blocker for Bug-611250
Yes, this should block, but let's reduce test cases for the Object.getPrototypeOf return value and DOM exception issues and get separate bugs on file for them, given that they seem like regressions from compartments.

Irakli: can you take this on?
Blocks: 611250
This patch just addresses the Widget API incompatibility issue.  Per comment 1, the other two issues need reduced test cases and their own bugs.
Attachment #493060 - Flags: review?(dietrich)
Attachment #493060 - Flags: review?(dietrich) → review+
https://github.com/mozilla/addon-sdk/commit/b2412945484b6878fc53e2b32c3f301a51e9bf59

Morphing this bug to be about the Widget API issue.  Let's get bugs on file with reduced test cases for the remaining issues.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Summary: content worker's misbehave with a real libraries. → the reddit-panel example uses the old Widget API
Note bug 614753 and bug 614757 on the remaining issues.  I have a reduced test case for the latter bug, but I don't have one for the former bug, and any help reducing a test case there would be much appreciated!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: