Closed Bug 742578 Opened 12 years ago Closed 12 years ago

Twitter bookmarklet zombie compartment

Categories

(Firefox :: General, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: geeknik, Unassigned)

References

Details

(Whiteboard: [MemShrink:P3])

I use the following bookmarklet to post to Twitter:

javascript:(function(){window.twttr=window.twttr||{};var%20D=650,A=280,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,url,text;%20if(C>A){G=Math.round((C/2)-(A/2))};%20url=encodeURIComponent(window.location);%20text=encodeURIComponent(window.getSelection?window.getSelection().toString():(document.selection?document.selection.createRange().text:''));%20if(text==''){%20window.alert('Please,%20select%20text%20on%20the%20page%20first');}else{%20window.twttr.shareWin=window.open('http://twitter.com/share?url='+url+'&text='+text,'','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');}}());

Highlight something, click the bookmarklet and it pops up a window to post the link to Twitter. However, after looking over about:memory?verbose I see this:

─62,752,218 B (05.82%) -- compartment(https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.indiegamemag.com%2Fnotch-announces-his-next-ambitious-game-0x10c%2F%3Futm_source%3Dfeedburner%26utm_medium%3Dfeed%26utm_campaign%3DFeed%253A%2BIndieGameMag%2B%2528The%2BIndie%2BGame%2BMagazine%2529&text=N&url=http%3A%2F%2Fwww.indiegamemag.com%2Fnotch-announces-his-next-ambitious-game-0x10c%2F%3Futm_source%3Dfeedburner%26utm_medium%3Dfeed%26utm_campaign%3DFeed%253A%2BIndieGameMag%2B%2528The%2BIndie%2BGame%2BMagazine%2529)
│    │   ├──37,711,872 B (03.50%) -- gc-heap
│    │   │  ├──13,980,304 B (01.30%) -- objects
│    │   │  │  ├───7,792,896 B (00.72%) ── function
│    │   │  │  └───6,187,408 B (00.57%) ── non-function
│    │   │  ├───8,192,776 B (00.76%) -- arena
│    │   │  │   ├──7,615,704 B (00.71%) ── unused
│    │   │  │   ├────294,624 B (00.03%) ── headers
│    │   │  │   └────282,448 B (00.03%) ── padding
│    │   │  ├───6,377,472 B (00.59%) ── scripts
│    │   │  ├───5,934,056 B (00.55%) -- shapes
│    │   │  │   ├──3,012,520 B (00.28%) ── tree
│    │   │  │   ├──2,106,960 B (00.20%) ── dict
│    │   │  │   └────814,576 B (00.08%) ── base
│    │   │  ├───1,868,832 B (00.17%) ── type-objects
│    │   │  └───1,358,432 B (00.13%) ── strings
│    │   ├──10,212,000 B (00.95%) ── script-data
│    │   ├───6,037,664 B (00.56%) -- shapes-extra
│    │   │   ├──4,144,288 B (00.38%) ── tree-tables
│    │   │   ├────955,840 B (00.09%) ── dict-tables
│    │   │   ├────536,128 B (00.05%) ── tree-shape-kids
│    │   │   └────401,408 B (00.04%) ── compartment-tables
│    │   ├───4,882,832 B (00.45%) -- objects
│    │   │   ├──4,668,160 B (00.43%) ── slots
│    │   │   ├────212,176 B (00.02%) ── elements
│    │   │   └──────2,496 B (00.00%) ── misc
│    │   ├───1,896,512 B (00.18%) -- type-inference
│    │   │   ├──1,371,584 B (00.13%) ── object-main
│    │   │   └────524,928 B (00.05%) ── tables
│    │   ├───1,482,378 B (00.14%) ── string-chars
│    │   ├─────327,680 B (00.03%) -- mjit
│    │   │     └──327,680 B (00.03%) ── code
│    │   └─────201,280 B (00.02%) ── analysis-temporary

That link was posted to Twitter at 11:58am CDT and it's now 6:16pm CDT. The window was closed immediately after posting to Twitter. Nice how it hung around all day. Guess Firefox wants to play 0x10c as much as I do. ;)

Windows 7 Pro x64, Nightly 4/04 Build (Built from http://hg.mozilla.org/mozilla-central/rev/25ec8b71e8ce).
Where'd you get the bookmarklet from?
This looks pretty busted.  It does

  window.twttr.shareWin=window.open('http://twitter.com

So as long as |window| lives, the window it opened will live.
The bookmarklet came from http://erlycoder.com/53/select-tweet-enhanced-twitter-bookmarklet. I figured I would use a bookmarket instead of an extension like Shareaholic, etc.
I gave this URL to the author on Google+ hopefully he is willing to look at this, update his code, etc. If not, I'll find another bookmarklet that works. The whole point of using bookmarklets was so that an extension wasn't loaded into memory all of the time. Feel free to mark this INVALID.
Does the compartment go away when you close the window you shared?
Nope. The parent window and the little popup was closed after sharing to Twitter. The compartment was still there 6/7 hours later.
(In reply to Brian Carpenter [:geeknik] from comment #6)
> Nope. The parent window and the little popup was closed after sharing to
> Twitter. The compartment was still there 6/7 hours later.

Hm.  Works fine for me.  Did you try in safe mode?
Whiteboard: [MemShrink]
The author has released an updated version @ http://erlycoder.com/67/twitter-facebook-bookmarklets-update.
Whiteboard: [MemShrink] → [MemShrink:P3]
The problem has corrected itself and is no longer happening.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.