Something like that might work? I don't know. I immediately think of "about:blank". More generally, I'm sure there are a lot of URL corner cases that I'm not familiar with (for example, today I discovered that Firefox supports bookmarks that start with "data:.."!). On top of that, I don't know what subset of those URLs the chrome.bookmarks API does and does not support. It'd be nice if an API could help me solve that so I'm not just blindly sending URLs at chrome.bookmarks.create, hoping Chrome is okay with it. I can check in the callback to see if the create succeeded or not, but I'd like to have a fighting chance before attempting to create a bookmark.
Colin Aaron Boodman wrote: > On Wed, Sep 16, 2009 at 5:18 PM, Colin Bleckner <[email protected] > <mailto:[email protected]>> wrote: > > Right now I've hacked together a function that checks to see if > the URL I'm about to add starts with known protocols and, if it > doesn't, automatically prepends "http://" to it. This (kind of) > works, but I'm still discovering that it doesn't handle certain > protocols like "chrome://" or <awesome new protocol that you guys > add in Chrome 5.0 that I didn't know existed> and I'm fiddling > with it more often than I'd like. My options are to either sit > down and write (or find) a complete URI parser in Javascript or > use whatever you guys have already built (and are going to keep up > to date for me!). You can imagine which option I prefer. :) > > > Couldn't it look and see if the URL contains the string "://" ? > > - a --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en -~----------~----~----~----~------~----~------~--~---
