How to manipulate LocalStorage from a browser based on the TChromim component in a Delphi application? To create it using Javascript, however, I need to consult with Delphi. Here is an example of how I create LocalStorage and handle with javascript:
chromium.Browser.MainFrame.ExecuteJavaScript("
var db = openDatabase('myDB', '1.0', 'Test DB', 2 * 1024 * 1024);
var msg,sql;
var maior, i;
db.transaction(function (qry) {
qry.executeSql('CREATE TABLE IF NOT EXISTS myTable (
id_link INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
link TEXT NOT NULL
);', [], null, null);
});
db.transaction(function (qry) {
sql = 'INSERT INTO myTable ( link) VALUES (".com.br")';
console.log(sql);
qry.executeSql(sql, [], null, null);
});
db.transaction(function (qry) {
qry.executeSql('SELECT * FROM myTable', [], function (qry, results) {
var len = results.rows.length;
msg = "Total Registros da busca: " + len ;
console.log(msg);
for (i = 0; i < len; i++){
msg = results.rows.item(i).id_link + " - " +results.rows.item(i).link;
console.log(msg);
}
}, null);
}); ", '', 0);
Thank you.