lundi 29 juin 2015

Set default search engine Chrome using meta table Not Working

There may be many variations to this question..but I am still unable to figure out how Chrome backend files work.

I am trying to set default search engine for Chrome, Firefox and IE using VC++ executable. I have been able to do so for Firefox and IE, but stuck in Chrome. I integrated SQLite with vc++ project and accessed Chrome's "Web Data" file to add my search engine to defaults list.

Now based on the link : Setting the Default Search Provider on Chrome via a script, I was able to add a search engine to defaults list of Chrome by adding entry to Web Data - keywords table.

Now to set it default, I added entry for key (if not present) : "Default Search Provider ID" to Web Data database and meta table.

        string query = "INSERT INTO meta (key, value) values ('Default Search Provider ID', " + std::to_string(engineId)+ ");";
        const char *sqlInsert = query.c_str();

        rc = sqlite3_exec(db, sqlInsert, NULL, NULL, &error);
        if (rc)
        {
            cerr << "Error executing SQLite3 statement: " << sqlite3_errmsg(db) << endl << endl;
            sqlite3_free(error);
            sqlite3_close(db);
        }

But this is not reflecting on Chrome. Also change in preferences file sets back the default search engine on reload of Chrome.

Aucun commentaire:

Enregistrer un commentaire