Closed Bug 854800 Opened 12 years ago Closed 8 years ago

provide some isReady(thing) method to take tabs, windows, and things

Categories

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

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: evold, Unassigned)

Details

Attachments

(1 file)

Whiteboard: [good first bug]
Hi I would like to work on this bug. Can you please give more info and how to go about it?
Flags: needinfo?(evold)
Ah sorry, we have to make sure that he module owner approves of this first. I suggest we create a module, maybe `sdk/view/ready` which exports an `isReady` function, which is a dispatcher, like so: const { dispatcher } = require("sdk/util/dispatcher"); const isReady = dispatcher("isReady"); ... As is done for `isPrivate` at the moment, and `isReady` can accept the same inputs which `isPrivate` currently supports. https://github.com/mozilla/addon-sdk/blob/c983c8e7138475def3d120ed1b5dce8c6b5a5409/lib/sdk/private-browsing/utils.js#L49-L54 Does this sound ok to you for a contributor to work on Irakli?
Flags: needinfo?(evold) → needinfo?(rFobic)
Sure that sounds fine by me.
Flags: needinfo?(rFobic)
Can I work on it now?
Flags: needinfo?(evold)
ya! :)
Flags: needinfo?(evold)
So basically what I need to do is create a ready.js which exports an isReady function based on the lines of isPrivate right?
(In reply to shreyas from comment #6) > So basically what I need to do is create a ready.js which exports an isReady > function based on the lines of > isPrivate right? yes, that's all correct, module would be at sdk/view/ready
How can I test my patch?
Flags: needinfo?(evold)
Attached patch bug854800.diffSplinter Review
Attachment #8557488 - Flags: review?(rFobic)
Comment on attachment 8557488 [details] [diff] [review] bug854800.diff I can take this one Irakli.
Flags: needinfo?(evold)
Attachment #8557488 - Flags: review?(rFobic) → review?(evold)
(In reply to shreyas from comment #8) > How can I test my patch? So you will want to make a `test/test-view-ready.js` file, require your new module, and assert that the expected outputs are generated for things like `isReady()` (here there are no arguments), `isReady(window)` where window is a top level window, or a low level nsIDOMWindow, and other inputs. Here is an example https://github.com/mozilla/addon-sdk/blob/master/test/test-private-browsing.js
I am not getting it. Could you please elaborate? Does the first patch that I submitted look correct?
Flags: needinfo?(evold)
(In reply to shreyas from comment #12) > I am not getting it. Could you please elaborate? Which part did you not understand? > Does the first patch that I > submitted look correct? The structure looks correct, the logic appears to be a copy of the `isPrivate` logic, so that would need to be changed. For instance we don't need `isReady.when(x => Ci.nsIPrivateBrowsingChannel && x instanceof Ci.nsIPrivateBrowsingChannel, x => x.isChannelPrivate);` or this line `isReady.when(isPermanentPrivateBrowsing, _=> true);`. Let's also have the default case return `undefined` for now instead of `isReady.define(() => false);` and we should replace `isReady.when(x => x instanceof Ci.nsIDOMWindow, isWindowPrivate);` with `isReady.when(x => x instanceof Ci.nsIDOMWindow, x.document.readyState == "interactive" || x.document.readyState == "complete");`
Flags: needinfo?(evold)
Comment on attachment 8557488 [details] [diff] [review] bug854800.diff Just getting this off my dashboard, f+ though, let me know if you have any questions about my previous comment.
Attachment #8557488 - Flags: review?(evold) → review-
Because of the difficulty finding mentors and the expected life span of the SDK, we are removing [good first bug] from remaining SDK bugs.
Whiteboard: [good first bug]
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: