Closed
Bug 271388
Opened 20 years ago
Closed 19 years ago
window.prompt failure in bookmarklet script
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
EXPIRED
People
(Reporter: matt, Assigned: bugzilla)
Details
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8a5) Gecko/20041122 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8a5) Gecko/20041122 Firefox/0.9.1+
I have been using a self-made bookmarklet for Dictionary.com for several years
now, and with the latest update to the nightly/latest-trunk (11/22/2004) this
bookmarklet has broken:
original code:
javascript:function dict()
{if(document.getSelection){selText=document.getSelection();}else{selText=document.selection.createRange().text;}
if(!selText){selText=prompt('Enter word to look up at
Dictionary.com:','');}if(selText){selText='search?q=' + escape(selText);
mgl=window.open('http://www.dictionary.com/' +
selText,'MGL','width=800,height=600,top=0,left=0,resizable,scrollbars');
to=setTimeout('mgl.focus()', 100);}} dict();
with this code, i was given an error in the JavaScript console that said that
document.getSelection was deprecated in favor of window.getSelection. in the
process of attempting to rewrite this code, i've discovered that window.prompt
apparently is broken.
here's the revised code (still in progress, as window.prompt is broken):
javascript:function dict() {var selText = '';if (window.getSelection){selText =
window.getSelection();} else if (document.getSelection){selText =
document.getSelection();} else if (document.selection){selText =
document.selection.createRange().text;} if ((selText=='')||(selText<'')) {
selText = window.prompt('Enter word to look up at
Dictionary.com:');alert('selText='+selText+'A');}if
(selText>''){selText='search?q=' +
escape(selText);mgl=window.open('http://www.dictionary.com/' +
selText,'MGL','width=800,height=600,top=0,left=0,resizable,scrollbars');to=setTimeout('mgl.focus()',
100);}}dict();
it will correctly ask for input (show the prompt) if no text is selected, but
then the alert (debug code to show value of selText) doesn't fire, and no pop-up
window is created. as everything works up to and including the prompt, i must
assume that the prompt functionality (setting the variable to the user's input)
must be broken in some way.
Reproducible: Always
Steps to Reproduce:
1. install provided code as a bookmarklet (plug the code into the location of a
bookmark)
2. click it.
3. enter a search term
4. click ok
Actual Results:
nothing.
Expected Results:
text that was input should have been alerted, and new window should have opened
with Dictionary.com search for the input text
as i said, i was using the original code (listed above) for years, and used it
as recently as *last night*, but now it is broken with the 11/22/2004
nightly/latest-trunk/
Comment 1•20 years ago
|
||
I wonder if this is the same as bug 272455.
Comment 2•20 years ago
|
||
Matthew, please retest with current trunk build.
Comment 3•19 years ago
|
||
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
Comment 4•19 years ago
|
||
This bug has been automatically resolved after a period of inactivity (see above comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
You need to log in
before you can comment on or make changes to this bug.
Description
•