Bug in Safari javascript RegExp?

This code splits the string into 2 pieces in Firefox and IE,
but just 1 piece in Safari. It seems like a bug in RegExp.
The "i" flag is supposed to mean the expression is
case-insensitive.
var r = new RegExp("x", "i");
var s = "helloXbye";
var parts = s.split(r);
alert("split into " + parts.length + " parts");
Windoze   Windows XP  

It looks like it's fixed now fyi:
2005-12-17 Geoffrey Garen <[email protected]>
Reviewed by Darin.
Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=6119
split() function ignores case insensitive modifier.
It looks like your report did the trick ra5ul

Similar Messages

  • Safari JavaScript bug I need to find/fix

    I am a webmaster of a popular site and I really want to support the Safari users but currently do not own a Mac so I was hoping someone here can help me track down a bug in my JavaScript that only effects Safari users.
    I checked my code with both old and new versions of Internet Explore and Firefox running under Windows XP and it works correctly. I have visitors telling me it is not correct under Safari, though again I cannot even verify this.
    Here is a page with the possible Safari bug:
    http://www.onlineconversion.com/volume.htm
    Enter 0.15 in the quantity field, choose "liter" on the left list box, and "ounce [US liquid]" on the right.
    Here is the correct result you should get:
    0.15 liter = 5.072 103 384 ounce [US, liquid]
    A Safari visitor of mine says he is getting 2.147 instead of the above. He says he is using version 1.2.4 of Safari
    Again I have no access to a Mac so I do not know if the bug does exist, if it is only for certain units or all units, so if someone can check and let me know it would be a big help. If you could also track down the bug I would forever be your friend.

    Here's the download page for Safari 2.0.1. (note the OS version in the 'System Requirements' box lower right).
    Just for confirmation, you can see on the pages you linked to that the OS version there is limited to the 10.3 range.
    FWIW this page is the location for the 1.3.1 update and you'll note that this is restricted to specifically OS 10.3.9 and is perhaps the latest version released for that operating system.
    Here's the page where all these come from... (note the first two links)
    Your page works fine for my 2.0.2 version as well so I'm certain this is a problem with outdated software and you should encourage the user to upgrade their Safari and see if that resolves the problem.
    Why is the default download the old version and a bit of extra digging is needed to find the latest version?
    I really don't know, but what I suspect is going on here is something along the lines of this:
    There is no point in downloading the latest Safari if one doesn't have 10.4 and to have 10.4 you must buy it and therefore will own a copy of Safari v.2 (actually called 'Safari RSS' to further muddy the waters). At this point the 'minor' upgrade(s) are then easily available from 'Software Update' or with a bit of digging on their downloads page.
    I'm assuming then that the older version is of less significance to them (piracy?) and is thus more widely available, or perhaps they have a policy to make older more established systems available as the default.
    Of course, unlikely, but on the other hand this could all just be an admin mistake that hasn't been spotted yet...
    EDIT: A thought just occurred to me: in both of these 'latest' updates they are both for very specific versions of their respective operating systems and as such Apple may prefer to direct users to the latest stable upgrades that are for the widest range of the relevant OS to avoid user problems. There's only two pathways for this - the page you referenced for 10.3, and by buying 10.4...
    Still, a little more page linking and advice might have been useful...

  • Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Extensions like Ghostery, WOT or AdBlock stop working after two or three times. Restarting the webpage in a new tab the extensions will work again for several times and then stop again. Has anybody an explanation or a workaround for this bug in Safari 5?

    Remove the extensions, redownload Safari, reload the extensions.
    http://www.apple.com/safari/download/
    And if you really want a better experience, use Firefox, tons more choices and possibilities there.
    Firefox's "NoScript" will block the Trojan going around on websites. Best web security you can get.
    https://addons.mozilla.org/en-US/firefox/addon/noscript/
    Ghostery, Ad Block Plus and thousands of add-ons more have originated on Firefox.

  • Ios7 bookamrking web application to home screen via Safari crashes after login and when we try to open any link inside. Can anyone please tell me if there is any scheduled fix for this bug in safari?

    ios7 bookmarking web application to home screen via Safari, crashes after login and when we try to open any link inside from the icon that gets created on the home screen. Can anyone please tell me if there is any scheduled fix for this bug in safari?
    From what i understand i see that - Cookies are not transferred between your website and your webapp when installing the icon on the home screen (for authentication purposes for example). It was working until 6.1 and now it’s not working anymore.
    Can someone please tell me if this bug will be fixed in any future release, if so the ticket number of some kind that i can track, or if there is a workaround for this issue?

    ios7 bookmarking web application to home screen via Safari, crashes after login and when we try to open any link inside from the icon that gets created on the home screen. Can anyone please tell me if there is any scheduled fix for this bug in safari?
    From what i understand i see that - Cookies are not transferred between your website and your webapp when installing the icon on the home screen (for authentication purposes for example). It was working until 6.1 and now it’s not working anymore.
    Can someone please tell me if this bug will be fixed in any future release, if so the ticket number of some kind that i can track, or if there is a workaround for this issue?

  • Is this a bug in Safari for iOS ??

    http://www.clfsrpm.net/sample/
    The control buttons above playlist display just fine in every Android, Linux, and Windows browser I have used - including Safari for Windows.
    However they do not display properly in Safari for iOS as tested on my iPod (but they do display correctly in Opera Mini for iPod)
    Is this a bug in Safari for iOS ??

    Why was this moved to "Using iPhone" ??
    It is a question about Safari for iOS - not iPhone/iPod usage.

  • Major bug in Safari 6: previous domain persists in URL bar when clicking a link

    I've noticed an extremely weird and significant bug in Safari 6 / Mountain Lion:
    When I'm navigating through a site, sometimes when clicking a link, Safari tries to open the corresponding URL on a previously visited site's domain instead of the current site.
    For example:
    First, I'm surfing on apple.com. Then, I navigate to another site, say estibot.com. On estibot.com, I click on a link that should take me to:
    http://www.estibot.com/tools.html
    Instead, safari takes me to http://www.apple.com/tools.html, which of course produces a 'not found' error. Nothing wrong with the link; this is purely Safari's doing.
    This happens often, and apparently can happen with any site.
    In other words, the domain name of a previously visited site persists in the URL, and the page that I'm trying to navigate to is added to the domain of the PREVIOUS site, not the actual site I'm using.
    This is a major bug and is often rendering Safari useless for my workflow. How could a bug like this end up in the finished product?
    Cheers
    Esa

    Having the same problem. It is randomly consistent, i.e. some links consistently get redirected to a specific domain. For example, I am experiencing this issue when using Basecamp and links being misdirected to a specific client's website. However, the criteria for why some links redirect and some do not appears random. This issue does not occur in Firefox. This leads me to believe that it is not a DNS issue. May be a Safari/DNS pair issue or solely a Safari issue. We do use an internal DNS (OS X Server) for browsing internal development wbsites which then rolls over to a public DNS. Again, this problem has never occured in Firefox and consistently occurs in Safari.
    Safari Version 6.0 (7536.25)
    Mac OS X Lion 10.7.4
    On a side note...
    Safari's strong-handed rewriting in the address bar as you type is crazy anoying. Or should I say "too helpful?" It seems to break the first rule of usuability: don't change the interface while the user is interacting with it.
    And the unified address/search is rediculously annoying for developers who use non-complient top level domains for internal development (such as .dev)
    And the new inspector seems like a huge step backwards in usuability. (debatable considering I'm probably not as advanced as some developers.)

  • IPad 2 Safari javascript window.open bug

    I am building a web app that uses the PicUp app to upload photos.
    Part of how it works requires me to open a new tab with javascript, which fires some script to open a new url in an iframe on the previous page.
    I have named the 'windows' accordingly, and it works properly on the iPad 1 (Safari).
    But in iPad 2, the window.open function does not seem to take in a target window parameter, resulting in broken UI. The new tab opens, but the script to open a new URL in the other page's iframe does not work.
    My image still uploads, but the user would be confused, as there is no confirmation screen.
    Help!
    PS: I would also like to comment that it is fairly convoluted to have to download a 3rd party app just to handle http uploads, something every other browser can do natively. What is the reasoning behind not allowing iOS Safari to upload like normal?
    Thanks
    John

    Was able to produce a small test case. 
    To demonstrate this problem, there are three pages.  You will need to load window1.html.  That page has buttons to load the other windows.  Make sure all files are in the same directory.
    window1.html
    <html>
    <head></head>
    <body>
    <script>
    window.name='win1';
    var si = setInterval('check()', 1000);
    function check()
        var d = new Date();
        var s = d.toString() + ' hash: ' + window.location.hash + "\n";
        var log = document.getElementById('log');
        log.value += s;
        log.scrollTop = log.scrollHeight
    </script>
    <form name='myform'>
    <input type=button name='cmd' value='Start second window (no close)' onclick="window.open('window2.html', 'win2')">  
    <input type=button name='cmd' value='Start third window (with close)' onclick="window.open('window3.html', 'win2')">
    <br />
    <textarea cols=80 rows=10 id='log'></textarea>
    </form>
    </body>
    </html>
    window2.html
    <html>
    <head></head>
    <body>
    <script>
    window.open('window1.html#from2','win1');
    </script>
    <p>This is window2.html</p>
    </body>
    </html>
    window3.html
    <html>
    <head></head>
    <body>
    <script>
    window.open('window1.html#from3','win1');
    window.close();
    </script>
    <p>This is window3.html</p>
    </body>
    </html>
    Test scenario:
    If you run window1.html, you will see it is updating the text field with the time and displaying the current hash.  If you press the button 'Start second window (no close)', you will see another tab open up and stay there and the window1 text field will display the hash 'from2'.
    You can close the window2 tab if you want now (don't think it matters).
    If you then press the button 'Start third window (with close), the window1 tab is gone and window3 is still up there.  The title bar says it is window3 but it is not even displaying 'This is window3.html'  If I do a view source (using a javascript bookmark), it does show the window3 script but the <p> and text is not there.  Probably died in the script before parsing was finished.  This is the first problem.
    Now load the window1.html again in the browser (type on URL line).  If you press the 'Start second window (no close)", the one that worked before, and click on the window1 tab to view it and display the updating text box, you will see it did not see the hash change.  This looks like that physical tab was corrupted in Safari from the window 3 test.  I just found if you open a new tab, the new tab will be ok to run the second window (no close test).  At least until you run window3 (with the close).

  • Safari javascript scrolling bug

    I want to update a position of element on page, when page is scrolling. Simple example here http://jsfiddle.net/guzich/o7hdmt8q/
    $(window).scroll(function(){ $("#test").css({ 'top':100+$(window).scrollTop()+'px' }) })
    It perfectly works in firefox and chrome, but in safari div element is twitches sometimes (you can try to scroll frequently scroll up and down to see it).

    I want to update a position of element on page, when page is scrolling. Simple example here http://jsfiddle.net/guzich/o7hdmt8q/
    $(window).scroll(function(){ $("#test").css({ 'top':100+$(window).scrollTop()+'px' }) })
    It perfectly works in firefox and chrome, but in safari div element is twitches sometimes (you can try to scroll frequently scroll up and down to see it).

  • Javascript RegExp bug?

    Hi,
    I'm sending this via email (no Internet access right now) so I hope it
    comes through properly
    In the ExtendScript console, try this:
    "hello".match(/[a-z]+/)
    The output is
    hello
    which is correct
    But if you try this:
    "hello".match(/[f-z]+/)
    the output is only
    h
    which is not what I would have expected. Shouldn't + match all
    characters that are within the range f-z?
    Can anyone help me understand this, or is it in fact a bug?
    Thanks,
    Ariel

    Hi John,
    Thanks for your response. Sorry for the formatting problems, but I think
    you did indeed decipher what came through correctly!
    I forgot that replace will only return a contiguous block. Now I
    remember that I've got to use arrays.
    What I was hoping was to extract from a given string only the letters I
    want: from "hello" everything but the e, for instance: "hllo"
    Your inverted idea should work, and also using a "g" tag at the end like
    you do, with a join("") should do the trick.
    Thanks for your help. I'll try and remember to mark the answer as
    correct when I have the chance.
    Ariel

  • IOS 5 Safari JavaScript execution exceeded timeout

    I am working on a mobile web app that is primarily self-contained and communicated with the server only when necessary. Currently, the libraries being used are:
    - jQuery 1.6.4
    - jQuery UI 1.8.3
    - Modified/patched version of jQTouch
    Up until the release of iOS 5 we were also using touchscroll.js but it is no longer needed since Safari now supports position: fixed and native scrolling.
    Since the release of iOS 5, seemingly at random, this exception is raised:
        JavaScript: Error undefined JavaScript execution exceeded timeout
    Once it is raised, no JS code that runs for more than a *very* short period of time (say 1ms) will be executed by Safari. Refreshing the page, going to a new page, or going to a new domain has no effect. Any and all JS code, even something as simple as
        for(var i = 0; i < 30; i++) ;
    will not be executed by the browser without the exception being raised. The only way around this is to force kill Safari and restart it. I suppose it is also possible to wrap any remotely "heavy duty" code in the application in a window.setTimeout(..., 1) or take advantage of Web Workers for everything but UI updates but that doesn't seem like a very good solution as the application is fairly large and it would require a substantial rewrite.
    Has anyone encountered this issue before? How would you go about debugging something like this as it isn't any single piece of code that seems to put Safari into this broken state and it can happen seemingly at random?
    I tried to figure out what the timeout of the JS engine is in mobile Safari by doing the following:
        var start, end;
        start = new Date();
        try {
           while(true);
        } catch (ex) {
          alert('test');
        end = new Date();
        console.log(Number(end) - Number(start) + 'ms');
    Unfortunately it seems this timeout exception isn't a JS exception so it cannot be caught in a try/catch block; however, it appears the max timeout period is in the realm of several seconds. None of the code in our app locks the browser/JS engine for that long (as it would provide a terrible UX) and most if not all of it probably has a sub 300ms execution time (including anything that's "heavy duty").

    illvminatvs wrote:
    Sometimes even simple DOM queries in jQuery like $('.foo') would trigger this behavior.
    There is nothing simple about jQuery. I'm pretty confident I could create a page where such a selector would bring any desktop browser to its knees.
    Moreover, this issue did not exist in iOS 4 and only manifested itself in iOS 5 and IIRC only occured on iPad 2 devices and not the original iPad.
    I highly doubt that.
    So call it what you will. I'll call it a bug.
    What I'll do is put on my overalls, grab my cane, and tell you how it was in my day.
    Back in my day, every operating system had bugs. Every application running on them had bugs. You know what we did? Blame the vendor? Yep. Filed a bug report? Sure. Sit on our hands? Never! You know what we did? We "worked around it". There was no internet where someone would post just the lines of code we needed. There were no example apps. There was no open source. Somehow, we still got it working.
    Just suppose, for the sake of argument, that you are absolutely correct. This is a bug the Apple introduced in iOS 5 and it breaks your app. Will Apple release a fix for it next month? Unlikely. Next quarter? Maybe, maybe not. 2015? My oldest Apple bug report is dated "04-Apr-2008 06:39 PM".
    It is an imperfect, competitive world. If you don't want to work around the bugs, all that does is give that opportunity to someone else.

  • Bugs in Safari 5.0.1

    Safari 5.0.1 bugs on Windows XP SP3:
    - Bookmarks flash when you move the mouse to bookmark folders.
    - Images flash on screen as they are loading; looks like garbage on the screen until the image starts loading (random dots over the browser window).
    Anything you've noticed?

    Old bugs still exist:
    - Modal windows like Save File and Javascript windows don't get focus and the mouse has to be clicked on the title bar of the message before it takes effect. (The space bar works OK instead of clicking a button, and doesn't require I click on the dialog box title first.)
    - Backspace in Flash: doesn't work. The browser picks it up instead of sending it to Flash. Other keys seem to work fine (0-9,A-Z, etc)

  • Bug report: Safari 5 fails to handle 8192 bit RSA certificates

    Running Safari 5.1.7 on OS X 10.6.8 -- I haven't confirmed for the version of Safari running on 10.7 -- and trying to access a site over https that uses an 8192 bits large RSA cert causes Safari to bug out. It can't display the certificate details correctly, giving just a garbled text output, and even a buggy interface dialog, and manually trying to accept the certificate to get the website to load causes Safari to run in an endless loop, displaying the certificate warning anew, over and over, making it impossible to load the page. The exact same certificate details put in a 4096 bit cert works just fine.
    Could anyone in the core dev team take a look at this? The number of sites making use of 8192 bit large certs is growing, and Safari is the only browser out there that can't handle it.
    add.: it seems the problem sits at a more fundamental level than in Safari, possibly in some underlying framework - apparently several other applications in OS X fails with handling an RSA cert of 8192 bits size, as mentioned in this thread: https://discussions.apple.com/message/11728527
    Possibly related: https://discussions.apple.com/message/3650856

    Could anyone in the core dev team take a look at this? The number of sites making use of 8192 bit large certs is growing, and Safari is the only browser out there that can't handle it.
    It might be worth registering (for free) as an Apple Developer:
    http://developer.apple.com/programs/register/
    ... and then you can use the Bug Reporter to submit trackable bug reports:
    http://developer.apple.com/bugreporter/

  • Full screen mode bug in Safari?

    In Safari, running in full screen mode, if a link opens a file (eg an Excel workbook), sometimes the Excel (non full screen) window will open over the top of the Safari full screen window. When that happens it's impossible to get access to the Excel window, as clicking on it will jump to the desktop "space" (where the window should have opened?). The only way out of the problem is to move to the Safari full screen "space" and take Safari out of full screen mode using the button in the top right corner (Esc doesn't work in this case). After that I can access both Safari and the Excel window no problem.
    This doesn't always happen, but it has happened enough times to be annoying, and also happens with other apps (eg Preview), not just Excel.
    Anyone else had the same problem?

    It is a bug. If you start to search for something with the Safari not in full screen mode the history and predictive search functionality is there. If you then expand the application window to full screen it the search field will continue to work as expected. However, if you open the application and first expand it to full screen view before using the search field it will not work properly; the history will be inaccessable and the predictive search will fail.  In order to restore functionality, hit 'control+command+F' to return to non-full-screen mode, type something in the search field or access your search history via the hour glass and then return to full screnn mode. The search field will now function normally again. This is definitely a bug and this behavior explains why the search seems to be fixed at times, and broken at others.

  • Safari Javascript on iPad2 no longer works 8.2 and 8.3

    Since updating myiPad2 to 8.2 and later 8.3, javascript elements in websites viewed with Safari and Chrome no longer work. I can successfully view/use these same websites on another iPad with an older IOS.
    Here's what  have tried so far:
    -soft reset (home+power)
    -clear safari cache/website data
    -forget network
    -toggle javascript on and off
    -every combination of the above
    -upgrade to 8.3 and repeat all of the above
    Does anyone have anything to add that I could try?
    Thank you.

    @sean0826 -- this is why you don't use Java menus. Even javascript menus are a bad idea; you need to have a secondary menu system ANYTIME you have a menu system that requires a plugin or scripting to be active. NOT EVERYONE browses with that stuff on.
    The only thing you can do for now is FTP to your site and add in static menus (like we did in the "old days" at the bottom of the page; or rip out the Java Menus and install static or CSS versions.
    BTW where are you rmenus supposed to be. I have opera, safari, ff, and a few others. they all look the same. So if that's true, it's the plugin that's the problem, not safari.
    In Opera Pogo.com works. java loads, the game is there. It does have some drawing issues but not surprised.
    In Safair Pogo works fine. Just played a game of chess.

  • Bug in Safari

    Hi
    Can't find a way to report a bug to apple so am posting here in the hope that someone from Apple will see it and do something.
    I use a lot of sites with an ASP content management system for updating web news stories via asp/html forms. When I use safari to type in (or paste in) to a multi-line text box it puts manual carriage returns in at the end of every line of the text box. Safari for iPad also does this. This makes the filed stories look really stupid. It makes no difference whether i type in directly or copy/paste out of another application.
    Neither IE for Windows nor Firefox for Windows or Mac do this. I haven't tested Safari for PC.
    The Safari behaviour makes it unusable for running my CMS's.
    It's not the end of the world, as I can use Firefox, but it is irritating.
    Hopefully Apple might like to look at this, if they're not too busy trying to fix the bugs in lion.....

    Safari > Report Bugs to Apple...

Maybe you are looking for