├── res └── ico │ ├── link16.png │ ├── star16.png │ ├── github-icon.png │ └── favicon_mascm.ico ├── converter.js └── index.html /res/ico/link16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lsauer/chrome-session-restore/HEAD/res/ico/link16.png -------------------------------------------------------------------------------- /res/ico/star16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lsauer/chrome-session-restore/HEAD/res/ico/star16.png -------------------------------------------------------------------------------- /res/ico/github-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lsauer/chrome-session-restore/HEAD/res/ico/github-icon.png -------------------------------------------------------------------------------- /res/ico/favicon_mascm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lsauer/chrome-session-restore/HEAD/res/ico/favicon_mascm.ico -------------------------------------------------------------------------------- /converter.js: -------------------------------------------------------------------------------- 1 | 2 | // author: (c) 2011 by Lorenz Lo Sauer; lsauer.com 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | // 22 | // Design 10/2011 by Lo Sauer, MIT-LICENSE or BSD-LICENSE 23 | // Design of the Chromium Logo by Google Inc.; Parts are Chrome CSS - BSD license applies 24 | 25 | /** 26 | * islib: see here for more; any unused functions are stripped 27 | */ 28 | var is = (function(){ 29 | return { 30 | xhrStatus : {}, //holds the status of the most recent XHR call 31 | Debug : false, // e.g. allow failing by throwing errors, logging... 32 | get FileAccess() { return typeof(window.File) !== 'undefined' && typeof(window.FileReader) === 'function' && typeof(window.FileList) !== 'undefined'; }, 33 | get DragSupport() { var el = document.getElementsByTagName('body')[0]; if(!el) return false; else return el.hasOwnProperty('ondragenter') && el.hasOwnProperty('ondragend'); }, 34 | }})(); 35 | 36 | /** 37 | * simple multi timer 38 | */ 39 | j2timer(); 40 | function j2timer(e){ 41 | window.tdiff || (window.tdiff = []); 42 | window.tdlog || (window.tdlog = []); 43 | window.fnred || (window.fnred = function(a,b){return a-b;}); 44 | 45 | //toogle statement 46 | if( (tdiff.length+1) % 2){ 47 | tdiff.push( Date.now()); 48 | return; 49 | } 50 | tdlog.push(["TIMER:", Date.now()-tdiff[tdiff.length-1], "[msec]; NOW:", Date.now(), "; WHO:", e, this.constructor.toString().split("(")[0]]); 51 | //commet this line out 52 | //console.log(tdlog.pop().join(" ") ); 53 | } 54 | 55 | //------------IMPLEMENTATION----------------// 56 | function eventstop(e){ 57 | e.stopPropagation(); 58 | e.preventDefault(); 59 | }; 60 | 61 | /** 62 | * concise element selector function; 09/2011 63 | */ 64 | function gEl(name){ //get Element by name [+childName] 65 | if( document.getElementById(name) != undefined ) 66 | return document.getElementById(name); 67 | else 68 | return document.getElementsByName(name)[0]; //first el is returned! 69 | } 70 | 71 | function gel(name, child){ //get Element by name [+childName] 72 | var el; 73 | if( name instanceof HTMLElement ) 74 | el = name; 75 | else 76 | if( document.getElementById(name) != undefined ) 77 | el = document.getElementById(name); 78 | else 79 | el = document.getElementsByName(name)[0]; 80 | if(child === undefined || el === undefined) 81 | return el; 82 | 83 | //search first within, otherwise outside... 84 | var regx = new RegExp(child, "gi"); 85 | for(var i=0, els = el.children; i v 12 210 | var freader = j2.freader; 211 | if( is.FileAccess ) { 212 | 213 | freader.onerror = function(e) { console.error('File error', e, e.target); }; 214 | //freader.onprogress = mconf.loader.onProgress; 215 | freader.onabort = function(e) { console.error('File read cancelled'); }; 216 | 217 | freader.onload = function(e) 218 | { 219 | var maxopen = +gel('maxtabs').value || 5; //max number of popups to open 220 | var elmenu = gel('recent-menu'); 221 | //console.log("onload:", e.target.result) 222 | j2.data = e.target.result; 223 | //Process file and build tab-list 224 | var urls = j2.data. 225 | split(/(?=(ftp|http|htttp):\/\/)/). 226 | filter(function(v){return v.length>6}). 227 | map( function(v,k,a){ var a=v.match(/(^(ftp|http|htttp):\/\/[a-z0-9|&!%$()?.\/=+#-;]+)/ig); if(a && a.length) return a.pop(); } ). 228 | filter(String); 229 | //=> modern browsers now have the powerful el.insertAdjacentHTML("afterBegin",....) 230 | //var html = ''+urls.length+' Tab(s)'; 231 | //access to local resources is not permitted: e.g. ''+ 232 | var html = urls.map( function(v){ if(v) return innerHTML = ''+ 233 | //not even via an iframe.... 234 | //''+ 235 | v.match(/(^(ftp|http|htttp):\/\/[a-z0-9.\-_]+)/i)[1] +'' }).join(''); 236 | elmenu.innerHTML = html; 237 | 238 | //create open all tabs -> limited to popups unfortunately on some browsers; works fine with Chrome (i.e. user-initiated action) 239 | var ela = document.createElement('a'); 240 | ela.href = '#'; 241 | ela.className = "recent-window recent-menu-item"; 242 | ela.innerHTML = urls.length+' Tab(s)'; 243 | //open the tabs upon clicking, requires user action; non-interaction: popup 244 | ela.onclick = function(){ urls.slice(0,maxopen).map(openTabsWin); }; 245 | elmenu.insertBefore(ela, elmenu.getElementsByTagName('a')[0]) 246 | 247 | console.log(urls) 248 | }; 249 | 250 | el.ondrop = function(e) 251 | { 252 | eventstop(e); 253 | for (var i = 0; i < e.dataTransfer.files.length; i++) { 254 | // e.dataTransfer is a DataTransfer object (https://developer.mozilla.org/En/DragDrop/DataTransfer), 255 | //e.dataTransfer.files is a FileList object (https://developer.mozilla.org/en/DOM/FileList) 256 | var file = e.dataTransfer.files[i]; // file is a File object (https://developer.mozilla.org/en/DOM/File) 257 | freader.readAsText(file); 258 | //console.log( "data FileReader:", freader); //undefined 259 | } 260 | if(j2.elIF.onchange) 261 | j2.elIF.onchange(e); 262 | }; 263 | 264 | el.ondragenter = el.ondragstart = function(e) { 265 | eventstop(e); /*must be on top for Firefox*/ 266 | //e.target.style.backgroundColor = "#ffc"; 267 | //j2.cls.add('jtxtactive'); 268 | e.target.className += /(jtxtactive)/ig.test(e.target.className) ? '' : ' jtxtactive'; 269 | }; 270 | //el.addEventListener('dragenter', function(e) {}, false); 271 | el.dragend = el.ondragleave = function(e) { 272 | eventstop(e); 273 | //e.target.style.backgroundColor = "#fff"; 274 | //j2.cls.del('jtxtactive'); 275 | e.target.className = e.target.className.replace(/[\s]*jtxtactive[\s]*/ig, ' '); 276 | }; 277 | el.addEventListener('dragover', function(e) { 278 | eventstop(e); 279 | }, false); 280 | console.log("DnD event listener added:" + this.div ); 281 | //document.getElementById(mconf.elfiles).addEventListener('change', this.onFileSelect, false); 282 | 283 | } 284 | }; 285 | //create a new uploader instance 286 | xhrUpld = xhrUploader( elTxtBxj ); 287 | }//endwith 288 | 289 | }; -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | JSON2SQL Service - JASON to SEQUEL 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 45 | 291 | 293 | 297 | 298 | 299 |
300 |
Created by Lo Sauer 2011 - BSD license
301 | Download the code from github
302 |

303 |

 Chrome Session Saver Loader

304 |


305 |
  • Drag and Drop a Chrome Session Saver File onto the Chrome-Footer bar or use the alternative file-upload, shown for none DnD-supported browsers. Your browser must support FileReader.
    306 |
    307 | Find your Chrome Session Saver files in  Chrome's Application Data folder (on Windows  c:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\, on Linux: ~/.config/google-chrome/Default) and sort by last modifications (Linux: ls -tr)
    308 |
    309 | Note: This project is not associated with Google, but the Google is associated with the Projects.
  • 310 |
    311 | 318 | 322 |
    323 |
    324 |
    325 | 326 | 327 | --------------------------------------------------------------------------------