logo
down
shadow

Chrome local storage deleting after NWJS application closes on Windows


Chrome local storage deleting after NWJS application closes on Windows

By : Dhelzy Dyan
Date : November 25 2020, 09:00 AM
I think the issue was by ths following , Today was released the alpha 6 version of NWJS at Google groups, you can check it here. This bug was actually solved with this update:
Changes (features ported from nw12) nwjc: compile JS to machine code for source code protection nw.Tray fix 'single-instance' support ('true' only) 'user-agent' in manifest 'dom_storage_quota' and 'additional_trust_anchors' in manifest Fix 'child_process.fork' Fix: unable to launch in some Linux distributions nw.App methods: argv, clearCache, setProxyConfig, addOriginAccessWhitelistEntry, removeOriginAccessWhitelistEntry, part of 'open' event support migrating localstorage data file on app start nw-gyp updated to 0.13.0: Fix native module build support
code :


Share : facebook icon twitter icon
Is there any way to view the local storage of a Windows 8 Store application in debugger?

Is there any way to view the local storage of a Windows 8 Store application in debugger?


By : Chong Shao Pin
Date : March 29 2020, 07:55 AM
may help you . Why look in the debugger? You can get the location and then go look in the file using Windows Explorer. Use the debugger to get the location from
Windows.Storage.ApplicationData.Current.LocalFolder;
How do you access a Metro app's local storage in a desktop application in Windows 8?

How do you access a Metro app's local storage in a desktop application in Windows 8?


By : Manoj Rawat
Date : March 29 2020, 07:55 AM
I wish this helpful for you Finding the local storage folder of a Windows 8 Style application
http://blog.falafel.com/Blogs/paul-tidwell/2012/08/27/finding-the-local-storage-folder-of-a-windows-8-style-application
code :
(Get-AppxPackage -AllUsers -Name  $name).PackageFamilyName
Store and retrieve data from local storage using chrome storage API

Store and retrieve data from local storage using chrome storage API


By : user2977340
Date : March 29 2020, 07:55 AM
seems to work fine First of all, you don't need to use the chrome.storage API to make this work. By the way, unfortunately, what you're looking for does not exist. You are looking for some event (like onBrowserClosed) that isn't implemented in the Chrome APIs. A bug report has been made HERE (although it actually isn't a bug), if you want to stay updated you can star it.
Although, you can still approach the problem with a setInterval(), that will execute your function to update the time a user has spent on a site every certain interval (in milliseconds), and will stop when the browser is closed. Something like this:
code :
var currentActiveTab, chromeHasFocus = false;

localStorage.timeSpentOnSites = localStorage.timeSpentOnSites || "{}";

// get the first tab at startup
chrome.tabs.query({active: true, highlighted: true}, function(tabs) {
    currentActiveTab = tabs[0];
    console.log('New active tab:', tabs[0]);
});

// this will keep currentActiveTab updated to always be the active tab (the one that the user is watching)
chrome.tabs.onUpdated.addListener(function(tabID, info, tab) {
    if (tab.active && tab.highlighted) currentActiveTab = tab;
    console.log('New active tab:', tab);
});

// this also
chrome.tabs.onActivated.addListener(function(info) {
    chrome.tabs.query({active: true, highlighted: true}, function(tabs) {
        currentActiveTab = tabs[0];
        console.log('New active tab:', tabs[0]);
    });
});

// this will check if chrome is active or not
chrome.windows.onFocusChanged.addListener(function(windowID) {
    if (windowID === chrome.windows.WINDOW_ID_NONE) {
        chromeHasFocus = false;
        console.log('Chrome lost focus.');
    } else if (!chromeHasFocus) {
        chromeHasFocus = true;
        console.log('Chrome has focus.');
    }
});

function addTimeSpentOnSite(site) {
    var T = JSON.parse(localStorage.timeSpentOnSites);

    // if site already exists increment the time spent on it
    if (T[site]) T[site]++;
    // otherwise set the time spent on it as 1 (second)
    else T[site] = 1;

    localStorage.timeSpentOnSites = JSON.stringify(T);
}

setInterval(function() {
    if (!chromeHasFocus) return;
    // if the chrome window isn't active the user is not watching the site

    var site = currentActiveTab.url.split('/')[2]; 
    // get the site name, something like www.site.com

    addTimeSpentOnSite(site);
    // increase the amount of time spent on the site
}, 1000);
Clear local storage when user closes window

Clear local storage when user closes window


By : Ashley
Date : March 29 2020, 07:55 AM
I hope this helps . How Do I clear local storage when my website is closed in all the tabs in a browser? means If my user is open my website in multiple tabs, and when user is close browser or close tabs one by one, I need to clear local storage on last tab close event (e.g. on "beforeunload" event). , This is how you do it:
Clear local storage when the browser closes in angular

Clear local storage when the browser closes in angular


By : Liu Lei
Date : March 29 2020, 07:55 AM
I wish this helpful for you I have created an angular 5 application. Which is using a token based system.Currently I am storing the token in the localstorage.I want the localstorage to be clear when the browser closes. and not clear the localstorage when the browser refreshes.The reason that I didn't use sesionstorage is because opening a page in a new tab or window will cause a new session to be initiate. How can I done this I tried with this code in app.component , You should do that way...
code :
import { Component, HostListener } from "@angular/core";

@Component({
    selector: 'app-root',
    templateUrl:"./app/app.component.html"
})

export class AppComponent {
    @HostListener("window:onbeforeunload",["$event"])
    clearLocalStorage(event){
        localStorage.clear();
    }
}
Related Posts Related Posts :
  • CRM 2013 Limit the date field
  • fancybox - changing close button color
  • Ember-notify giving error can't read property "Service" of undefined
  • Passport-init.js authentication is not working in nodejs
  • Branch.io Cordova API - init() fails on Android Device
  • appending HTML codes to an elements using js
  • Css animation to extend button text on hover
  • I want to restrict HTML input autocomplete to 3 letter minimum
  • tinyMCE editor not updating on the fly
  • typescript kendo-ui call method from string
  • HttpCompileException was unhandled by user code (when i am adding c# code in script)
  • Send form data as array of objects to controller in asp.net mvc
  • Javascript, multi file modules and Require.Js
  • how to render a complete new template and leave the application template in ember
  • Hover unrelated divs
  • Permute string until it matches some input?
  • How to fire JQuery change event when input value changed programmatically?
  • AJAX: POST data to a different url
  • checkbox column in jquery datatable
  • Document.evaluate for documents without namespaceURI crashes Microsoft Edge
  • Bootstrap Menu with "More" option Responsive issue
  • Standard inputs not being added to Angularjs Form $Scope
  • Express promise throw error
  • onclick and get in jquery
  • How to get the country code from Google Places API
  • Passing parameters url in Select2
  • Is there any frame work for Marklogic to write javascript code?
  • How to implement a boostrap template over bootstrap-sass gem
  • Why fixed div comes out when horizontally scrolled?
  • How to limit scope of a function in javascript/ jquery
  • Overlapping legend d3.js
  • Apply transition to div
  • Javascript game help - counting with dice
  • How to hide a div from angular controller
  • Can Promise load multi urls in order?
  • How enable Hover event for bootstrap menus?
  • D3 scale.invert() isn't returning date for x
  • Parsing object to array using underscore js or lodash
  • ES6 with React and Browserify
  • AngularJS Factory return type undefined
  • javascript follow html input fields
  • how to declare a double array in javascript for this particular UI
  • Jquery : find length of mixed list
  • Returning the array before the function is complete & Angular JS
  • Javascript set value of class & hidden input in nested divs
  • Register custom filters with vue.js
  • Add class to input parent
  • Angular controller not talking to view
  • Trouble creating "if then" Javascript statement to change background color of page
  • Socket.IO - Middleware and scoping: how should I access global IO object from external middleware?
  • add class when input is valid in angularjs
  • Positioning multiple div elements
  • Checkbox clicking works, deselecting checkbox not working Javascript
  • Adding ajax jQuery File upload
  • Creating a dynamic array within a dynamic array in JQuery
  • Multiple File Upload actions for a single File Input PHP/JS
  • Want to move an added element to a different part of the DOM
  • Why can't I get Angularjs to work?
  • Minimizing browser window in Firefox & Chrome adds white space to right of page
  • I need to insert the date and time of employee stamp in and out into mysql database
  • shadow
    Privacy Policy - Terms - Contact Us © animezone.co