Skip to content

Commit

Permalink
Modify for version 0.3.1
Browse files Browse the repository at this point in the history
- Add page translation function that use Simultaneous page transition to right click menu
- Reduced the number of files using asar archive
- Addition of update information notification
- Add the latest history information to the top page
  • Loading branch information
kura52 authored and kura52 committed Sep 10, 2017
1 parent 9ce963d commit ec934d4
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 81 deletions.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ This browser makes use of wonderful web technologies, starting with the followin
Both the installer for every platform and the portable version can be downloaded.
To use the portable edition, please run sushi.exe for Windows and sushi-browser for Mac/Linux after decompressing.

- [Windows Installer v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-setup-x64.exe)
- [Windows Portable v0.3.0(self-extract)](https://sushib.me/dl/sushi-browser-0.3.0-win-x64.exe)
- [Windows Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-win-x64.zip)
- [MacOS dmg v0.3.0](https://sushib.me/dl/SushiBrowser-0.3.0.dmg)
- [MacOS Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-mac-x64.zip)
- [Linux rpm (for Fedora/CentOS) v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0.x86_64.rpm)
- [Linux deb (for Debian/Ubuntu) v0.3.0](https://sushib.me/dl/sushi-browser_0.3.0_amd64.deb)
- [Linux Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0.tar.bz2)
- [Windows Installer v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-setup-x64.exe)
- [Windows Portable v0.3.1(self-extract)](https://sushib.me/dl/sushi-browser-0.3.1-win-x64.exe)
- [Windows Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-win-x64.zip)
- [MacOS dmg v0.3.1](https://sushib.me/dl/SushiBrowser-0.3.1.dmg)
- [MacOS Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-mac-x64.zip)
- [Linux rpm (for Fedora/CentOS) v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1.x86_64.rpm)
- [Linux deb (for Debian/Ubuntu) v0.3.1](https://sushib.me/dl/sushi-browser_0.3.1_amd64.deb)
- [Linux Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1.tar.bz2)

# Use of Flash
If Flash won't run, please install Flash from the following web sites.
Expand All @@ -154,6 +154,14 @@ sushi-browser --no-sandbox
```

# New Features

#### New function(v0.31)
- Add page translation function that use Simultaneous page transition to right click menu
- Reduced the number of files using asar archive
- Addition of update information notification
- Add the latest history information to the top page
- Improved performance when new window is opened

#### New function(v0.30)
- Able bind other windows to the panel (Only for Windows and Linux )
Note: Please install wmctrl when using on Linux. (apt-get install wmctrl or yum(dnf) install wmctrl)
Expand All @@ -167,6 +175,7 @@ sushi-browser --no-sandbox
- Introducing the full text search in history function (Experimental)
- Deleting unnecessary data (Reducing some download size)


#### New Function (v0.20-v0.21)
- Search engines can be selected.
- Multiple simultaneous search function, (For example, if you input "g4 word" in the address bar, you can search in multiple panels with different conditions simultaneously.)
Expand All @@ -180,14 +189,14 @@ sushi-browser --no-sandbox
- Improve right click menu line order
- Changing the action of the mouse's middle click by pressing for a long time and clicking only. (For normal clicking, the opposite panel will be opened as link. When pressing for a long time, the same panel will be open in the background as link. )

![Newv03](https://sushib.me/myimg/new_features_0.3.gif)
![Newv03](https://sushib.me/myimg/new_features5.gif)

# TODO

- Improved top page's customizability
- Modify prinave mode bugs
- Enhanced Anything Search
- Adblock control panel
- Make multiple tabs selectable
- can be selected as a standard browser
- Addition of build method in the Readme
- Refactoring, introduction of Mobx (currently closely integrated with the PubSub base)
Expand Down
16 changes: 8 additions & 8 deletions brave/app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,14 @@ exports.init = function (language) {
const appendLangProperties = function (lang) {
// Property files to parse (only ones containing menu specific identifiers)
propertyFiles.push(
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'menu.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'app.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'error.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'passwords.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'common.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'newtab.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'preferences.properties').replace('app.asar/','app.asar.unpacked/'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'chrome.properties').replace('app.asar/','app.asar.unpacked/'))
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'menu.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'app.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'error.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'passwords.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'common.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'newtab.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'preferences.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'),
path.join(__dirname, '../../resource/extension/default/1.0_0/locales', lang, 'chrome.properties').replace(/app.asar([\/\\])/,'app.asar.unpacked$1'))
}

appendLangProperties(lang)
Expand Down
8 changes: 4 additions & 4 deletions brave/extension/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports.init = (verChange) => {
})

let loadExtension = (ses,extensionId, extensionPath, manifest = {}, manifestLocation = 'unpacked') => {
extensionPath = extensionPath.replace('app.asar/','app.asar.unpacked/')
extensionPath = extensionPath.replace(/app.asar([\/\\])/,'app.asar.unpacked$1')
console.log(path.join(extensionPath, 'manifest.json'))
fs.exists(path.join(extensionPath, 'manifest.json'), (exists) => {
if (exists) {
Expand All @@ -103,12 +103,12 @@ module.exports.init = (verChange) => {

let getPath = (appId) => {
const extRootPath = path.join(app.getPath('userData'),'resource/extension')
// const extRootPath = path.join(__dirname,'../../resource/extension').replace('app.asar/','app.asar.unpacked/')
// const extRootPath = path.join(__dirname,'../../resource/extension').replace(/app.asar([\/\\])/,'app.asar.unpacked$1')
if(!fs.existsSync(extRootPath)) {
fs.mkdirSync(extRootPath)
}
const appPath = path.join(extRootPath,appId)
const orgPath = path.join(__dirname,'../../resource/extension',appId).replace('app.asar/','app.asar.unpacked/')
const orgPath = path.join(__dirname,'../../resource/extension',appId).replace(/app.asar([\/\\])/,'app.asar.unpacked$1')
if(verChange || true || !fs.existsSync(appPath)){
if(fs.existsSync(orgPath)){
fs.copySync(orgPath, appPath)
Expand Down Expand Up @@ -149,7 +149,7 @@ module.exports.init = (verChange) => {
loadExtension(ses,...getPath('occjjkgifpmdgodlplnacmkejpdionan'),(void 0),'component')
}

const appIds = fs.readFileSync(path.join(__dirname,'../../resource/extensions.txt').replace('app.asar/','app.asar.unpacked/')).toString().split(/\r?\n/)
const appIds = fs.readFileSync(path.join(__dirname,'../../resource/extensions.txt').replace(/app.asar([\/\\])/,'app.asar.unpacked$1')).toString().split(/\r?\n/)
for(let appId of appIds) {
if(appId.match(/^[a-z]+$/)){
if(!first && appId == 'niloccemoadcdkdjlinkgdfekeahmflj') continue
Expand Down
27 changes: 17 additions & 10 deletions ja/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ Sync Data機能をOnにすると複数端末間で履歴とお気に入りの同

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

- [Windows Installer v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-setup-x64.exe)
- [Windows Portable v0.3.0(自己解凍)](https://sushib.me/dl/sushi-browser-0.3.0-win-x64.exe)
- [Windows Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-win-x64.zip)
- [MacOS dmg v0.3.0](https://sushib.me/dl/SushiBrowser-0.3.0.dmg)
- [MacOS Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0-mac-x64.zip)
- [Linux rpm (for Fedora/CentOS) v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0.x86_64.rpm)
- [Linux deb (for Debian/Ubuntu) v0.3.0](https://sushib.me/dl/sushi-browser_0.3.0_amd64.deb)
- [Linux Portable v0.3.0](https://sushib.me/dl/sushi-browser-0.3.0.tar.bz2)
- [Windows Installer v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-setup-x64.exe)
- [Windows Portable v0.3.1(自己解凍)](https://sushib.me/dl/sushi-browser-0.3.1-win-x64.exe)
- [Windows Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-win-x64.zip)
- [MacOS dmg v0.3.1](https://sushib.me/dl/SushiBrowser-0.3.1.dmg)
- [MacOS Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1-mac-x64.zip)
- [Linux rpm (for Fedora/CentOS) v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1.x86_64.rpm)
- [Linux deb (for Debian/Ubuntu) v0.3.1](https://sushib.me/dl/sushi-browser_0.3.1_amd64.deb)
- [Linux Portable v0.3.1](https://sushib.me/dl/sushi-browser-0.3.1.tar.bz2)

ポータブル版の利用は、解凍後にWindowsはsushi.exeを、Mac/Linuxはsushi-browserを実行ください。

Expand All @@ -158,6 +158,14 @@ sushi-browser --no-sandbox
```

# 新機能

#### 新機能(v0.31)
- 同期ページ遷移を利用した翻訳機能を右クリックメニューに追加
- asarを利用してファイル数を削減
- ブラウザの更新情報の通知機能を追加
- トップページに最新履歴の表示を追加
- 新規ウインドウ生成時のパフォーマンス向上

#### 新機能(v0.30)
- 他のウインドウをパネルに吸着する機能(WindowsとLinuxのみ)
注意:Linuxで利用する場合はwmctrlをインストールください。(apt-get install wmctrl or yum(dnf) install wmctrl)
Expand Down Expand Up @@ -185,12 +193,11 @@ sushi-browser --no-sandbox
- 右クリックメニューの並び順の改善
- マウスの中クリックの長押しと通常クリックの挙動を変更(通常クリックの場合、対面パネルにリンクが開かれる。長押しの場合は、同じパネルにbackgroundでリンクが開かれる)

![Newv03](https://sushib.me/myimg/new_features_0.3.gif)
![Newv03](https://sushib.me/myimg/new_features5.gif)

# TODO

- トップページのカスタマイズ性の向上
- プラベートモードのバグ修正
- Anything Searchの強化
- adblockの制御パネル
- 標準のブラウザとして選択可能とする
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"exclude_globs": [
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/*_sidebar.html",
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/favorite.html",
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/explorer.html"
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/explorer.html",
"chrome://brave/*"
],
"run_at": "document_end"
} ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"exclude_globs": [
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/*_sidebar.html",
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/favorite.html",
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/explorer.html"
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/explorer.html",
"chrome-extension://dckpbojndfoinamcdamhkjhnjnmjkfjd/explorer.html",
"chrome://brave/*"
],
"run_at": "document_end"
} ],
Expand Down
2 changes: 1 addition & 1 deletion src/Aria2cWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')

const binaryPath = path.join(__dirname, '../resource/bin/aria2',
process.platform == 'win32' ? 'win/aria2c.exe' :
process.platform == 'darwin' ? 'mac/bin/aria2c' : 'linux/aria2c').replace('app.asar/','app.asar.unpacked/')
process.platform == 'darwin' ? 'mac/bin/aria2c' : 'linux/aria2c').replace(/app.asar([\/\\])/,'app.asar.unpacked$1')



Expand Down
11 changes: 9 additions & 2 deletions src/BrowserWindowPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function setOptionVal(key,dVal,val){
}

export default {
async load(opt){
async load(opt,first){
let initWindow
const setting = await InitSetting.val
let winSetting = opt ? getSize(opt) : {x: setting.x, y: setting.y, width: setting.width, height: setting.height, maximize: setting.maximize}
Expand All @@ -192,6 +192,7 @@ export default {
}
const lang = await locale.init(mainState.language)
app.setLocale(lang)
mainState.lang = lang == 'zh-CN' ? lang : lang.slice(0,2)


mainState.dragData = null
Expand Down Expand Up @@ -252,7 +253,11 @@ export default {
if(winArg.y >= maxHeight) winArg.y = 100

let getParam = ""
if(opt && opt.tabParam){

if(first){
getParam="#"
}
else if(opt && opt.tabParam){
getParam = `?tabparam=${encodeURIComponent(opt.tabParam)}`
if(opt.dropX){
winArg.x = opt.dropX - (mainState.toggleNav == 1 && winArg.width ? Math.round(winArg.width / 3) : 0)
Expand All @@ -269,6 +274,7 @@ export default {
console.log(opt,winArg)
}


console.log(909,winArg)
if(!win){
winArg.width = winArg.width || setting.width
Expand All @@ -293,6 +299,7 @@ export default {
win.setBounds({x: winArg.x, y: winArg.y, width: winArg.width || setting.width, height: winArg.height || setting.height})
win.setSkipTaskbar(false)
win.setTitle('Sushi Browser')
// win.reload()
win.loadURL(`chrome://brave/${path.join(__dirname, '../index.html').replace(/\\/g,"/")}${getParam}`)
console.log(winArg,setting)

Expand Down
5 changes: 4 additions & 1 deletion src/checkUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {state} from './databaseFork'
import mainState from './mainState'
const locale = require('../brave/app/locale')
const uuid = require('node-uuid')
const path = require('path')
const fs = require('fs')


function checkUpdate(ver,checkedVersion){
Expand All @@ -30,7 +32,8 @@ function checkUpdate(ver,checkedVersion){
}

state.findOne({key: 1}).then(rec=>{
const {ver,checkedVersion} = rec
const {checkedVersion} = rec
const ver = fs.readFileSync(path.join(__dirname,'../VERSION.txt')).toString()
setTimeout(_=>checkUpdate(ver,checkedVersion || '0.00'),1000)

setInterval(_=>checkUpdate(ver,checkedVersion || '0.00'),1000*3600*5)
Expand Down
8 changes: 4 additions & 4 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ app.on('ready', async ()=>{
extensions = require('../brave/extension/extensions')
extensions.init(setting.ver !== fs.readFileSync(path.join(__dirname,'../VERSION.txt')).toString())
require('./faviconsEvent')(async _ => {
await createWindow()
await createWindow(true)

require('./menuSetting')
process.emit('app-initialized')
Expand All @@ -151,7 +151,7 @@ app.on('ready', async ()=>{
syncReplaceName = rec.val.split("\t")[0]
}
else{
syncReplace.insert({key:'syncReplace_0',val:`${locale.translation('2473195200299095979')}\t(.+)\thttps://translate.google.co.jp/translate?sl=auto&ie=UTF-8&u=$$1`})
syncReplace.insert({key:'syncReplace_0',val:`${locale.translation('2473195200299095979')}\t(.+)\thttps://translate.google.co.jp/translate?sl=auto&tl=${mainState.lang}&hl=${mainState.lang}&ie=UTF-8&u=$$1`})
syncReplaceName = locale.translation('2473195200299095979')
}
})
Expand Down Expand Up @@ -440,8 +440,8 @@ function setFlash(app){
}
}

function createWindow (opt) {
const initWindow = BrowserWindowPlus.load(opt)
function createWindow (first) {
const initWindow = BrowserWindowPlus.load((void 0),first)
return initWindow
}

Expand Down
23 changes: 18 additions & 5 deletions src/render/TabPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,18 @@ export default class TabPanel extends Component {
const tokenCloseSyncTabs = PubSub.subscribe('close-sync-tabs',(msg,{k,sync})=>{
if(this.props.k == k || !sync) return
const tab = this.state.tabs.find(x => x.sync == sync)
if(tab) this.handleTabClose({noSync: true},tab.key)
if(tab){
if(tab.syncReplace){
Array.from(new Array(5)).map((_,n)=>{
this.refs[`navbar-${tab.key}`].refs.syncReplace.setVal(n,0,false)
})
tab.syncReplace = void 0
tab.sync = void 0
}
else{
this.handleTabClose({noSync: true},tab.key)
}
}
})

const tokenSyncZoom = PubSub.subscribe('sync-zoom',(msg,{k,sync,percent})=>{
Expand Down Expand Up @@ -1381,7 +1392,7 @@ export default class TabPanel extends Component {
if (tab.wvId && id == tab.wvId) {
const rec = await syncReplace.findOne({key: 'syncReplace_0'})
if(rec){
console.log(777666,!tab.syncReplace,(rec.val.split("\t")))
console.log(777666,tab.syncReplace,(rec.val.split("\t")))
this.refs[`navbar-${tab.key}`].refs.syncReplace.setVal(0,0,!tab.syncReplace)
}
}
Expand Down Expand Up @@ -1633,7 +1644,7 @@ export default class TabPanel extends Component {
let retryNum = 0
let winInfos = this.props.getScrollPriorities((void 0),dirc)
const index = winInfos.findIndex(x=>x[0] == this.props.k)
const winInfo = winInfos[index]
let winInfo = winInfos[index]
console.log('sync-mode', url,dirc,sync,replaceInfo)

const idParent = window.setInterval(()=> {
Expand All @@ -1651,8 +1662,10 @@ export default class TabPanel extends Component {
}
if (!tab.wv || !this.getWebContents(tab)) return

if(!winInfos){
winInfos = this.props.getScrollPriorities((void 0),dirc)
if(!winInfo){
const winInfos = this.props.getScrollPriorities(0, dirc);
const index = winInfos.findIndex(x => x[0] == this.props.k);
winInfo = winInfos[index];
}

exeScript(tab.wv,()=>clearInterval(id), ()=> {
Expand Down
10 changes: 8 additions & 2 deletions src/render/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ global.zoomMapping = new Map([
[110,1],[125,2],[150,3],[175,4],[200,5],[250,6],[300,7],[400,8],[500,9]
])

for(let [url,path] of Object.entries(mainState.favicons)){
localStorage.setItem(url,path)
if(location.href.endsWith("index.html#")){
try{
for(let [url,path] of Object.entries(mainState.favicons)){
localStorage.setItem(url,path)
}
}catch(e){
console.log(e)
}
}


Expand Down
Loading

0 comments on commit ec934d4

Please sign in to comment.