Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:53:44+00:00 2026-06-06T03:53:44+00:00

I’m trying to create a bookmark extension in Chrome and I want to leverage

  • 0

I’m trying to create a bookmark extension in Chrome and I want to leverage WebSQL to store all kind of information about bookmarks locally. Here’s what I’ve done so far:

(function() {
  var Home,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;

  Home = (function() {

    function Home() {
      this.onDBInit = __bind(this.onDBInit, this);      this.db = openDatabase("Journal", "", "Bookmarks Stats", 5 * 1024 * 1024, this.onDBInit, this.onDBError);
    }

    Home.prototype.onDBInit = function(db) {
      console.log(db.version);
      db.changeVersion("", "1.0", this.initDB, this.onDBError);
      return console.log(db);
    };

    Home.prototype.initDB = function(t) {
      console.log(t);
      return t.executeSql('CREATE TABLE bookmarks (id, title, url)');
    };

    Home.prototype.onDBError = function(e) {
      return console.log(e);
    };

    return Home;

  })();

  window.Registerable(Home);

}).call(this);

For some reason, changeVersion ALWAYS fails. I have tried to delete the database, restart chrome, etc. Chrome version: 18.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:53:45+00:00Added an answer on June 6, 2026 at 3:53 am

    In my limited experience, changeVersion does work on Chrome. I’ve also read complaints here about it not working properly on Safari, but it does.

    However, there are two catches:

    Catch 1:

    Often, changeVersion appears to fail (it gives an error and db.version will still return the old value), but the transaction callback will fire and when you re-open the web page and its database, the version number will be correct.

    Catch 2:

    It seems you must supply precisely five arguments, including three callbacks. If you don’t supply these five arguments, for example you only do the first three, then the current version will remain unchanged. So if you were to follow the instruction in this tutorial that everyone’s referring to, you would be disappointed.

    This is the case for Chrome and Safari on Windows.

    Arguments are:
    1: expected version
    2: new version
    3: transaction callback (you can execute SQL here as part of the version change)
    4: failure callback (if version change or transaction callback failed)
    5: succes callback (if version change and transaction callback succeeded)

    I haven’t tested this on iOS devices but it matches the Safari specifications provided here:
    https://developer.apple.com/library/safari/#documentation/iphone/conceptual/safarijsdatabaseguide/usingthejavascriptdatabase/usingthejavascriptdatabase.html

    In Opera, changeVersion waits with setting db.version to its new value until after you’ve executed an actual sql transaction using executeSql. So I use a SELECT statement that has no further consequence. This does not actually have to be inside the transaction callback: I discovered it when I tried a separate executeSql statement in the browser console after trying a whole bunch of changeVersion commands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.