Browse Source

removed unneeded code

Gildas 7 years ago
parent
commit
de47cfb654

+ 0 - 1
extension/core/bg/autosave.js

@@ -97,7 +97,6 @@ singlefile.autosave = (() => {
 		options.autoSave = true;
 		options.incognito = tab.incognito;
 		options.tabId = tabId;
-		options.sessionId = 0;
 		let index = 0, maxIndex = 0;
 		options.onprogress = async event => {
 			if (event.type == event.RESOURCES_INITIALIZED) {

+ 0 - 2
extension/core/content/content-bootstrap.js

@@ -47,7 +47,6 @@ this.singlefile.bootstrap = this.singlefile.bootstrap || (async () => {
 	async function autoSavePage() {
 		if ((!autoSavingPage || autoSaveTimeout) && !singlefile.pageAutoSaved) {
 			autoSavingPage = true;
-			options.sessionId = 0;
 			if (options.autoSaveDelay && !autoSaveTimeout) {
 				autoSaveTimeout = setTimeout(() => {
 					autoSavePage();
@@ -95,7 +94,6 @@ this.singlefile.bootstrap = this.singlefile.bootstrap || (async () => {
 
 	function onUnload() {
 		if (!singlefile.pageAutoSaved || options.autoSaveUnload) {
-			options.sessionId = 0;
 			const docData = docHelper.preProcessDoc(document, window, options);
 			if (this.frameTree && !options.removeFrames) {
 				browser.runtime.sendMessage({

+ 2 - 2
lib/frame-tree/frame-tree.js

@@ -58,7 +58,7 @@ this.frameTree = this.frameTree || (() => {
 	}, true);
 	return {
 		getAsync: async options => {
-			const sessionId = options.sessionId;
+			const sessionId = options.sessionId || 0;
 			options = JSON.parse(JSON.stringify(options));
 			return new Promise(resolve => {
 				sessions.set(sessionId, { frames: [], resolve });
@@ -66,7 +66,7 @@ this.frameTree = this.frameTree || (() => {
 			});
 		},
 		getSync: options => {
-			const sessionId = options.sessionId;
+			const sessionId = options.sessionId || 0;
 			options = JSON.parse(JSON.stringify(options));
 			sessions.set(sessionId, { frames: [] });
 			initRequest({ windowId, sessionId, options });