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)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: evold, Unassigned)
Details
Attachments
(1 file)
747 bytes,
patch
|
evold
:
review-
|
Details | Diff | Splinter Review |
Priority: -- → P3
Reporter | ||
Updated•11 years ago
|
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)
Reporter | ||
Comment 2•10 years ago
|
||
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)
So basically what I need to do is create a ready.js which exports an isReady function based on the lines of
isPrivate right?
Reporter | ||
Comment 7•10 years ago
|
||
(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
Attachment #8557488 -
Flags: review?(rFobic)
Reporter | ||
Comment 10•10 years ago
|
||
Flags: needinfo?(evold)
Attachment #8557488 -
Flags: review?(rFobic) → review?(evold)
Reporter | ||
Comment 11•10 years ago
|
||
(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
Comment 12•10 years ago
|
||
I am not getting it. Could you please elaborate? Does the first patch that I submitted look correct?
Flags: needinfo?(evold)
Reporter | ||
Comment 13•10 years ago
|
||
(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)
Reporter | ||
Comment 14•10 years ago
|
||
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-
Comment 15•8 years ago
|
||
Because of the difficulty finding mentors and the expected life span of the SDK, we are removing [good first bug] from remaining SDK bugs.
Updated•8 years ago
|
Whiteboard: [good first bug]
Comment 16•8 years ago
|
||
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.
Description
•