Skip to content

Commit

Permalink
Version up 0.25.7.
Browse files Browse the repository at this point in the history
Fixed to reflect Chrome history deletion. (issue #64)
Increased timeout value of current state save process at application end from 2 seconds to 1 minute.
Fixed a bug related to the frequency of acquiring page thumbnails.
Updated youtube-dl to 2019.07.12.
  • Loading branch information
kura52 committed Jul 13, 2019
1 parent a4be012 commit 2863f68
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 43 deletions.
13 changes: 12 additions & 1 deletion README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.25.6
0.25.7
6 changes: 3 additions & 3 deletions ja/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ Puppeteer(ヘッドレスChromeでの自動化) APIと互換性のあるAPIを

各プラットフォームに対し、インストーラとポータブル版の両方がダウンロードできます。

- [Windows Installer v0.25.6](https://sushib.me/dl/sushi-browser-0.25.6-setup-x64.exe)
- [Windows Portable v0.25.6(Chromium同梱)](https://sushib.me/dl/sushi-browser-0.25.6-win-x64-chromium.zip)
- [Windows Portable v0.25.6](https://sushib.me/dl/sushi-browser-0.25.6-win-x64.zip)
- [Windows Installer v0.25.7](https://sushib.me/dl/sushi-browser-0.25.7-setup-x64.exe)
- [Windows Portable v0.25.7(Chromium同梱)](https://sushib.me/dl/sushi-browser-0.25.7-win-x64-chromium.zip)
- [Windows Portable v0.25.7](https://sushib.me/dl/sushi-browser-0.25.7-win-x64.zip)

ポータブル版の利用は、解凍後にWindowsはsushi.exeを、Mac/Linuxはsushi-browserを実行ください。
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sushi-browser",
"version": "0.25.6",
"version": "0.25.7",
"description": "Sushi Browser",
"main": "./lib/main.js",
"author": "kura52",
Expand Down
12 changes: 7 additions & 5 deletions src/BrowserWindowPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,13 @@ function create(args){
const maxBounds = bw.getBounds()

if(!saved){
bw.webContents.send('get-window-state', true)
console.log(88811)
let flag = false

_startAutoSaveAllWindowsState().then(()=>{
ipcMain.once('get-window-state-reply',async (e,ret)=>{
bw.webContents.send('get-window-state', true)
ipcMain.once('get-window-state-reply',(e,ret)=>{
_startAutoSaveAllWindowsState().then(async ()=>{
console.log(888112)
console.log(888113)

console.log('close-save')
await clearDatas()
Expand Down Expand Up @@ -264,7 +266,7 @@ function create(args){
saved = true
if(!bw.isDestroyed()) bw.close()
}
},2000)
},60000)
e.preventDefault()
}
else{
Expand Down
26 changes: 26 additions & 0 deletions src/remoted-chrome/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,10 @@ Or, please use the Chromium bundled version.`
}
})

let historyOnVisitedProcessing = 0
const {history} = require('../databaseFork')
this.addListener('history', 'onVisited', async (valid, h)=>{
++historyOnVisitedProcessing
const item = await history.findOne({location: h.url})
if(item){
if(valid){
Expand All @@ -910,12 +912,33 @@ Or, please use the Chromium bundled version.`
}
}
else if(valid){
console.log('history', 'onVisited', valid, h)
await history.insert({location:h.url ,title: h.title || h.url, created_at: h.lastVisitTime ,updated_at: h.lastVisitTime,count: h.visitCount})
}
--historyOnVisitedProcessing
}, void 0, (result) => new Promise(resolve => {
chrome.history.search({text: result.url},results => resolve([!!results.find(r=>r.url == result.url), result]))
}))

this.addListener('history', 'onVisitRemoved', async removed=>{
for(let i=0;historyOnVisitedProcessing && i<100;i++){
await new Promise(r=>setTimeout(r,30))
console.log('history', 'onVisitRemoved','wait')
}
if(removed.allHistory){
history.remove({}, { multi: true })
}
else{
if(typeof removed.urls === 'string'){
history.remove({location: removed.urls})
}
else{
console.log('history', 'onVisitRemoved', removed)
history.remove({location: {$in: removed.urls}}, { multi: true })
}
}
})

this.addListener('windows', 'onCreated', window => {
console.log(9992,window)
if(this.popuped){
Expand All @@ -927,6 +950,9 @@ Or, please use the Chromium bundled version.`

this.addListener('windows', 'onRemoved', removedWinId => {
if(PopupPanel.instance.id == removedWinId){
for (const win of BrowserWindow.getAllWindows()) {
win.getTitle().includes('Sushi Browser') && win.webContents.send('close-browser-action')
}
PopupPanel.instancePre = PopupPanel.instance
PopupPanel.instance = {}
return
Expand Down
9 changes: 7 additions & 2 deletions src/remoted-chrome/webContents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import robot from 'robotjs'
import {BrowserWindow, ipcMain, nativeImage, webContents as _webContents} from 'electron'
import {app, BrowserWindow, ipcMain, nativeImage, webContents as _webContents} from 'electron'
import {EventEmitter} from 'events'
import evem from './evem'
import fs from 'fs'
Expand Down Expand Up @@ -384,7 +384,12 @@ export default class webContents extends EventEmitter {
async loadURL(url, options){
if(isFirstLoad === void 0){
isFirstLoad = false
if(!(await require('../databaseFork').state.findOne({key: 1}))) url = 'chrome://welcome/'
if(!(await require('../databaseFork').state.findOne({key: 1}))){
try{
require('../BrowserWindowPlus').saveState(this._getBrowserPanel().browserWindow,_=>{})
}catch(e){}
url = 'chrome://welcome/'
}
}

try{ new URL(url) }catch(e){ url = mainState.searchProviders[mainState.searchEngine].search.replace('%s',url) }
Expand Down
6 changes: 5 additions & 1 deletion src/render/BrowserActionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class BrowserActionWebView extends Component {
this.changePos2 = this.changePos.bind(this,{})
ipc.on('set-bound-browser-view', this.changePos2)


if(this.close){
ipc.send('set-overlap-component', 'extension-popup', this.props.k, this.props.tab.key, 0,-1,0,0)
}
Expand All @@ -197,6 +196,7 @@ class BrowserActionWebView extends Component {
ipc.removeListener('get-webview-pos',this.changePos)
ipc.removeListener('set-bound-browser-view', this.changePos2)
ipc.send('set-overlap-component', 'extension-popup', this.props.k, this.props.tab.key, 0,-1,0,0)
ipc.removeListener('send-to-host',this.ipcEvent)
}

onClose = ()=>{
Expand Down Expand Up @@ -333,6 +333,9 @@ export default class BrowserActionMenu extends Component{
}
ipc.on('set-overlap-component-open', this.otherOpen)

this.closeBrowserAction = e => this.close()
ipc.on('close-browser-action',this.closeBrowserAction)

this.tokenStartLoading = PubSub.subscribe(`on-load-start_${this.props.tab.key}`,(msg,url)=>{
const newState = []
let needUpdate = false
Expand Down Expand Up @@ -372,6 +375,7 @@ export default class BrowserActionMenu extends Component{
ipc.removeListener(`chrome-browser-action-get-info-${this.props.id}`,this.getInfo)
ipc.removeListener(`chrome-browser-action-enable-${this.props.id}`,this.enable)
ipc.removeListener('set-overlap-component-open', this.otherOpen)
ipc.removeListener('close-browser-action',this.closeBrowserAction)
PubSub.unsubscribe(this.tokenStartLoading)
PubSub.unsubscribe(this.tokenDidNavigate)
}
Expand Down
26 changes: 15 additions & 11 deletions src/render/TabPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ export default class TabPanel extends Component {
// self.sendOpenLink(tab, page);
// page.navUrl = url
// },
onDidFinishLoading(e, page) {
console.log('onDidFinishLoading',e)
onDidFinishLoading(e, page, call) {
console.log(22009,'onDidFinishLoading',call)
if (!self.mounted) return

page.didNavigate = false
Expand Down Expand Up @@ -1517,7 +1517,7 @@ export default class TabPanel extends Component {

ipc.send('get-did-finish-load',tab.wvId,tab.key,tab.rSession)
ipc.once(`get-did-finish-load-reply_${tab.wvId}`,(e,c)=> {
console.log(`get-did-finish-load-reply_${tab.wvId}`,c)
console.log(22009,`get-did-finish-load-reply_${tab.wvId}`,c)
if(!c || !self.mounted) return
const loc = c.url
const entryIndex = c.currentEntryIndex
Expand Down Expand Up @@ -1548,14 +1548,18 @@ export default class TabPanel extends Component {
// self.setState({})
self.setStatePartical(tab)
PubSub.publish(`change-status-${tab.key}`)
;(async () => {
if ((typeof page.hid === 'object' && page.hid !== null ) || (page.hid = await history.findOne({location: page.navUrl}))) {
console.log(22, page.hid)
if (page.hid.count > 2 && !page.hid.capture) {
ipc.send('take-capture', {id: page.hid._id, url: page.navUrl, loc, tabId: tab.wvId, noActiveSkip: true})
if(!call){
;(async () => {
const isExists = typeof page.hid === 'object' && page.hid !== null
if(isExists) ++page.hid.count
if (isExists || (page.hid = await history.findOne({location: page.navUrl}))) {
console.log(22009, loc, page.hid)
if (page.hid.count > 2 && !page.hid.capture) {
ipc.send('take-capture', {id: page.hid._id, url: page.navUrl, loc, tabId: tab.wvId, noActiveSkip: true})
}
}
}
})()
})()
}
// ipc.send('chrome-tab-updated',parseInt(tab.key), e, self.getChromeTab(tab))
})

Expand All @@ -1570,7 +1574,7 @@ export default class TabPanel extends Component {
},
onDidStopLoading(e, page){
if(page.didNavigate){
this.onDidFinishLoading(e,page)
this.onDidFinishLoading(e,page, 'onDidStopLoading')
}

if(page.isLoading || page.favicon == 'loading'){
Expand Down
38 changes: 20 additions & 18 deletions tools/versionUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@ const glob = require("glob")
const BEFORE_CODE_NAME = 'Geso(Squid arms)'
const CODE_NAME = 'Fugu(Blowfish)'
const CURRENT_APP_VERSION = fs.readFileSync('../VERSION.txt').toString()
const NEXT_APP_VERSION = "0.25.6"
const NEXT_APP_VERSION = "0.25.7"
const NEXT_APP_VERSION2 = `${NEXT_APP_VERSION.split(".").slice(0,-1).join('.')}${NEXT_APP_VERSION.split(".").slice(-1)[0]}`

const CHANGE_ENGLISH = `Bug fix display of popup window of Chrome extension.
Added "Main Menu > More tools > Enable Mouse Gesture".
Added processing to open tabs in correct panel when restoring session.
Startup stability improvement (If the browser process remains in an incorrect state, added the process to stop the process at startup).
Fixed Sort Menu.
Fixed the problem that the address bar is not focused by timing when creating a new tab.
Removed processing to delay startup maximization.
Enabled browser update check function.`

const CHANGE_JAPANESE = `Chrome拡張のポップアップウインドウの表示不具合修正
「メインメニュー>その他のツール>マウスジェスチャーを有効にする」を追加。
セッション復元時に、正しいパネルにタブを開くように履いた処理を追加
起動の安定性向上(不正な状態でブラウザのプロセスが残っていた場合、起動時にそのプロセスを停止する処理を追加した)
Sort Menuの動作不具合を修正
新規タブ作成時に、タイミングによってアドレスバーにフォーカスされない不具合を修正
起動時の最大化遅延処理を削除
ブラウザの更新チェック機能を有効化`
const CHANGE_ENGLISH = `Fixed the problem that the order is not saved after executing "Sort Menu".
Fixed the bug that the order of tabs is incorrect when creating many tabs.
Changed to save session when exiting application.
Changed to delete Chrome download history after download.
Fixed window maximization process at startup.
Fixed to reflect Chrome history deletion. (issue #64)
Increased timeout value of current state save process at application end from 2 seconds to 1 minute.
Fixed a bug related to the frequency of acquiring page thumbnails.
Updated youtube-dl to 2019.07.12`

const CHANGE_JAPANESE = `「Sort Menu」実行後に、順序が保存されない不具合を修正
多数のタブを作成した場合に、タブの順序が変わってしまう不具合を修正
アプリケーション終了時にセッションを保存するように変更
ダウンロード終了後にChromeのダウンロード履歴を削除するように変更
起動時のウインドウ最大化処理を修正
Chromeの履歴削除を反映するように修正
アプリケーション終了時の現在状態保存処理のタイムアウト値を2秒から1分に増加
ページサムネイルを取得する頻度に関する不具合の修正
youtube-dlを2019.07.12にバージョンアップ`

const isWindows = process.platform === 'win32'
const isDarwin = process.platform === 'darwin'
Expand Down

0 comments on commit 2863f68

Please sign in to comment.