From 34f788fdf311e274eef5907503b72283fe390e6b Mon Sep 17 00:00:00 2001 From: MatMoul Date: Mon, 2 Oct 2017 21:29:23 +0200 Subject: [PATCH] Large change --- src/js/background.js | 158 +++++++++++++++++++++++++++++++------------ src/manifest.json | 2 - src/src.zip | Bin 20082 -> 19601 bytes src/test/test.html | 9 +++ src/test/test.js | 21 ++++++ 5 files changed, 144 insertions(+), 46 deletions(-) create mode 100644 src/test/test.html create mode 100644 src/test/test.js diff --git a/src/js/background.js b/src/js/background.js index 36cedc5..15c787e 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -111,30 +111,87 @@ core.Bookmarks.getItem = function(bookmarkItem, path){ // Return BookmarkItem fr } core.SiteInfos = {} // Siteinfos helper object -core.SiteInfos.loadInfos = function(url, args, callback){ // args: { icon: false; screenshot: false }, callback( { url, title, (/!\ Not handled now)icon, screenshot } || error: {} ) +core.SiteInfos.fromTab = function(callback){ // Retrieve infos from current tab. callback( { url, title, icon, screenshot } || error: callback() ) + browser.tabs.getCurrent().then(function(tab){ + function whaitLoaded(){ + browser.tabs.get(tab.id).then(function(tab){ + if(tab.status == 'loading') setTimeout(whaitLoaded, 300); + else{ + browser.tabs.update(tab.id, {active: true}).then(function(){ + setTimeout(function(){ + browser.tabs.captureVisibleTab().then(function(img){ + browser.tabs.remove(tab.id); + if(callback) callback( { url: tab.url, title: tab.title, icon: tab.favIconUrl, screenshot: img } ); + }, function(){ + browser.tabs.remove(tab.id); + if(callback) callback(); + }); + }, 300); + }, function(){ + if(callback) callback(); + }); + } + }, function(){ + if(callback) callback(); + }); + } + setTimeout(whaitLoaded, 300); + }, function(){ + if(callback) callback(); + }); +} +core.SiteInfos.fromNewTab = function(url, callback){ // Retrieve infos from a new tab. callback( { url, title, icon, screenshot } || error: callback() ) + browser.tabs.create({url: url, active: false}).then(function(tab){ + browser.tabs.update(tab.id, {muted: true}).then(); + function whaitLoaded(){ + browser.tabs.get(tab.id).then(function(tab){ + if(tab.status == 'loading') setTimeout(whaitLoaded, 300); + else{ + browser.tabs.update(tab.id, {active: true}).then(function(){ + setTimeout(function(){ + browser.tabs.captureVisibleTab().then(function(img){ + browser.tabs.remove(tab.id); + if(callback) callback( { url: tab.url, title: tab.title, icon: tab.favIconUrl, screenshot: img } ); + }, function(){ + browser.tabs.remove(tab.id); + if(callback) callback(); + }); + }, 300); + }, function(){ + if(callback) callback(); + }); + } + }, function(){ + if(callback) callback(); + }); + } + setTimeout(whaitLoaded, 300); + }, function(){ + if(callback) callback(); + }); +} +core.SiteInfos.fromFrame = function(url, callback){ // Retrieve infos from an iframe. callback( { url, title, (/!\ Not handled now)icon, screenshot } || error: callback() ) function pageLoaded(){ if(!iframe) return; var docTitle = iframe.contentWindow.document.title; var docIcon = null; var docScreenshot = null; + //title if(docTitle == '') docTitle = url; - if(args && args.icon){ - // - } - if(args && args.screenshot){ - var canvas = document.createElement('canvas'); - canvas.style.width = previewWidth.toString() + 'px'; - canvas.style.height = previewHeight.toString() + 'px'; - canvas.width = previewWidth / 2; - canvas.height = previewHeight / 2; - var ctx = canvas.getContext('2d'); - ctx.clearRect(0, 0, previewWidth, previewHeight); - ctx.save(); - ctx.scale(0.5, 0.5); - ctx.drawWindow(iframe.contentWindow, 0, 0, previewWidth, previewHeight, 'rgb(255, 255, 255)'); - ctx.restore(); - docScreenshot = canvas.toDataURL(); - } + //icon + //screenshot + var canvas = document.createElement('canvas'); + canvas.style.width = previewWidth.toString() + 'px'; + canvas.style.height = previewHeight.toString() + 'px'; + canvas.width = previewWidth / 2; + canvas.height = previewHeight / 2; + var ctx = canvas.getContext('2d'); + ctx.clearRect(0, 0, previewWidth, previewHeight); + ctx.save(); + ctx.scale(0.5, 0.5); + ctx.drawWindow(iframe.contentWindow, 0, 0, previewWidth, previewHeight, 'rgb(255, 255, 255)'); + ctx.restore(); + docScreenshot = canvas.toDataURL(); document.body.removeChild(iframe); iframe = null; @@ -149,15 +206,14 @@ core.SiteInfos.loadInfos = function(url, args, callback){ // args: { icon: false xmlHttp.open('GET', url, true); xmlHttp.onload = function(){ iframe = document.createElement('iframe'); - iframe.referrerPolicy = "unsafe-url"; iframe.width = previewWidth iframe.height = previewHeight iframe.style.position = 'absolute'; - iframe.style.visibility = 'hidden'; - document.body.appendChild(iframe); + //iframe.style.visibility = 'hidden'; var content = xmlHttp.responseText.replace('', ''); - iframe.srcdoc = content; iframe.onload = function(){ pageLoaded(); } + document.body.appendChild(iframe); + iframe.srcdoc = content; setTimeout(function(){ pageLoaded(); }, 6000); } xmlHttp.onabort = function(){ if(callback) callback(); } @@ -165,6 +221,10 @@ core.SiteInfos.loadInfos = function(url, args, callback){ // args: { icon: false xmlHttp.ontimeout = function(){ if(callback) callback(); } xmlHttp.send(); } +core.SiteInfos.fromWS = function(url, callback){ // Retrieve infos from a Web Service. callback( { url, title, (/!\ Not handled now)icon, screenshot } || error: callback() ) + console.log('Not implemented'); + return core.SiteInfos.fromFrame(url, callback); +} core.GridNodes = {}; // GridNodes helper object core.GridNodes.sync = function(gridNode, rootPath){ // Sync GridNodes with Bookmarks @@ -237,7 +297,7 @@ core.GridNodes.getNode = function(gridNode, path){ // Return GridNode from RootG core.GridNodes.refreshNode = function(gridNode, callback){ // Refresh content of a GridNode if(gridNode.__isLoading == true) return; gridNode.__isLoading = true; - core.SiteInfos.loadInfos(gridNode.url, { screenshot: true }, function(infos){ + core.SiteInfos.fromFrame(gridNode.url, function(infos){ if(infos){ gridNode.title = infos.title; gridNode.image = infos.screenshot; @@ -280,27 +340,37 @@ core.GridNodes.setNodeIndex = function(gridNode, index, newIndex, callback){ // } core.GridNodes.capturePage = function(gridNode, callback){ browser.tabs.create({url: gridNode.url, active: false}).then(function(tab){ - setTimeout(function(){ - tab.active = true; - browser.tabs.update(tab.id, {active: true}).then(function(){ - browser.tabs.captureVisibleTab().then(function(img){ - //gridNode.title = tab.title - browser.tabs.remove(tab.id); - gridNode.image = img; - browser.bookmarks.update(gridNode.id, { - title: gridNode.title - }).then(function(bookmarkItem){}, function(){}); - core.Settings.save(); - if(callback) callback(); - browser.runtime.sendMessage({ command: 'gridNodesSynced'}).then(function(){}, function(){}); - }, function(){ - browser.tabs.remove(tab.id); - if(callback) callback(); - }); - }, function(){ - if(callback) callback(); - }); - }, 4000); + browser.tabs.update(tab.id, {muted: true}).then(function(){}, function(){}); + function whaitLoaded(){ + browser.tabs.get(tab.id).then(function(tab){ + if(tab.status == 'loading'){ + setTimeout(whaitLoaded, 300); + } else{ + browser.tabs.update(tab.id, {active: true}).then(function(){ + setTimeout(function(){ + browser.tabs.captureVisibleTab().then(function(img){ + browser.tabs.remove(tab.id); + gridNode.title = tab.title + gridNode.image = img; + browser.bookmarks.update(gridNode.id, { + title: gridNode.title + }).then(function(bookmarkItem){}, function(){}); + core.Settings.save(); + if(callback) callback(); + browser.runtime.sendMessage({ command: 'gridNodesSynced'}).then(function(){}, function(){}); + }, function(){ + browser.tabs.remove(tab.id); + if(callback) callback(); + }); + }, 300); + }, function(){ + if(callback) callback(); + }); + } + }, function(){}); + + } + setTimeout(whaitLoaded, 300); }, function(){ if(callback) callback(); }); diff --git a/src/manifest.json b/src/manifest.json index 083918d..1981a58 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -19,8 +19,6 @@ "" ], - "content_security_policy": "default-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'; script-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'; child-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'; frame-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'; object-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'; style-src * moz-extension: 'self' 'unsafe-inline' 'unsafe-eval'", - "background": { "scripts": ["js/background.js"] }, diff --git a/src/src.zip b/src/src.zip index 8f68dca050b69ed565805b80dc5cfe55fc8f3a44..2bdaea78f17dca622f29e80b0105a93a90b6e68b 100644 GIT binary patch delta 8267 zcmZ9R1yCK!*0wk97TjUu?he6%YjAgm;BJEl4YF~E;O363@i@luR*FSk%&eO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%YKQQK&L<|utA1Er*J9oK+eLXIK6fwa48=Y_#iV8QnnNX zAfp&l2o*{GC;$9C5IFRS`M+rB|1X5sc>l6r;<+q;;>o`S@PPk8F#iC}|7YOPp8r$) z3uyjR{=Yt>{H-<<_;bGhd{p_T?tg8?zjYvRsF2K`!vE~d{}ldfgL+l`GsoaiV_5*; okJ|1!@&M=9q08JejPqj{*SZ&2h`$(Pyhe` diff --git a/src/test/test.html b/src/test/test.html new file mode 100644 index 0000000..4de64cb --- /dev/null +++ b/src/test/test.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/test/test.js b/src/test/test.js new file mode 100644 index 0000000..b6284bb --- /dev/null +++ b/src/test/test.js @@ -0,0 +1,21 @@ +var url = 'https://www.matmoul.ch'; +var xmlHttp = new XMLHttpRequest(); +xmlHttp.timeout = 10000 +xmlHttp.open('GET', url, true); +//xmlHttp.setRequestHeader('X-PINGOTHER', 'pingpong'); +//xmlHttp.setRequestHeader('Content-Type', 'text/plain'); +//xmlHttp.setRequestHeader('Access-Control-Request-Method', '*'); +//xmlHttp.setRequestHeader('Origin', url); +//xmlHttp.setRequestHeader('Access-Control-Allow-Origin', '*'); +xmlHttp.onload = function(){ + iframe = document.getElementById('iframe'); + iframe.width = 800 + iframe.height = 600 + iframe.style.position = 'absolute'; + //iframe.style.visibility = 'hidden'; + var content = xmlHttp.responseText.replace('', ''); + //iframe.onload = function(){ pageLoaded(); } + //document.body.appendChild(iframe); + iframe.srcdoc = content; +} +xmlHttp.send();