Closed Bug 992560 Opened 11 years ago Closed 11 years ago

Make console.time available to content scripts

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: anaran, Assigned: anaran)

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
zombie
: review+
Details | Review
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release) Build ID: 20140404030202 Steps to reproduce: Add // Begin of content script console.time('loading...'); // Code of content script goes here... // End of content script console.timeEnd('loading...'); Actual results: console.error: snapper: Message: TypeError: console.time is not a function Stack: @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///c:/cygwin/tmp/tmpol8sai.mozrunner/extensions/jid1-HE38Y6vsW9TpHg@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://jid1-he38y6vsw9tphg-at-jetpack/snapper/data/display.js:12:9 @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///c:/cygwin/tmp/tmpol8sai.mozrunner/extensions/jid1-HE38Y6vsW9TpHg@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://jid1-he38y6vsw9tphg-at-jetpack/snapper/data/display.js:7:2 Expected results: console.time(name) and console.timeEnd(name) should be available in content scripts like they already are in the addon main module. I already sent a tested pull request to https://github.com/mozilla/addon-sdk/pull/1454
Attached file Pull Request
Attachment #8402219 - Flags: review?
Attachment #8402219 - Flags: review? → review?(tomica+amo)
Assignee: nobody → adrian
Status: UNCONFIRMED → ASSIGNED
No longer depends on: 641463
Ever confirmed: true
Comment on attachment 8402219 [details] [review] Pull Request the tests don't pass, and it looks like this wouldn't work even with updated tests. i couldn't understand why with a quick look through the code, so you might need to investigate a bit deeper.
Attachment #8402219 - Flags: review?(tomica+amo) → review-
yeah, my hunch was right, it's a problem with our LoaderWithHookedConsole mock, see here: https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/test/loader.js#L64
Comment on attachment 8402219 [details] [review] Pull Request good work Adrian, thank you for your effort.. (and tenacity ;) if you would like to continue contributing, check out these "good first bugs": https://bugzilla.mozilla.org/buglist.cgi?cmdtype=runnamed&namedcmd=sdk1st
Attachment #8402219 - Flags: review- → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/fd052efb773691fc7c35ffe1d3d57d70a3de82c3 Bug 992560 - Make console.time available to content scripts https://github.com/mozilla/addon-sdk/commit/594db92090d870e3b426851d0cc6d80201d72d45 Merge pull request #1454 from anaran/master Bug 992560 - Make console.time available to content scripts, r=@zombie
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
(In reply to Tomislav Jovanovic [:zombie] from comment #4) > Comment on attachment 8402219 [details] [review] > Pull Request > > good work Adrian, thank you for your effort.. (and tenacity ;) It's great to see this change go in! > > if you would like to continue contributing, check out these "good first > bugs": > > https://bugzilla.mozilla.org/buglist.cgi?cmdtype=runnamed&namedcmd=sdk1st The search named sdk1st does not exist.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: