@@ -69,6 +69,26 @@ async function newtab() {
69
69
if ( store . get ( 'bookmarks' ) == null ) {
70
70
store . set ( 'bookmarks' , [ ] )
71
71
}
72
+ if ( ! fs . existsSync ( path . join ( app . getPath ( 'userData' ) , 'custom.css' ) ) ) {
73
+ fs . writeFile (
74
+ path . join ( app . getPath ( 'userData' ) , 'custom.css' ) ,
75
+ `/*
76
+ This is a CSS file to customize Reamix.
77
+ It is applied to tabs and icons and not to pages such as settings.
78
+ */`
79
+ )
80
+ }
81
+ if (
82
+ ! fs . existsSync ( path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) )
83
+ ) {
84
+ fs . writeFile (
85
+ path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) ,
86
+ `/*
87
+ This is a CSS file to customize Reamix.
88
+ These apply to pages such as Home, Settings and Extensions.
89
+ */`
90
+ )
91
+ }
72
92
if ( store . get ( 'adblocker' ) ) {
73
93
ElectronBlocker . fromPrebuiltAdsAndTracking ( fetch ) . then ( ( blocker ) => {
74
94
blocker . enableBlockingInSession ( browserview . webContents . session )
@@ -577,33 +597,14 @@ ipcMain.handle('browserGoes', (e, index) => {
577
597
ipcMain . handle ( 'getBrowserUrl' , ( e , index ) => {
578
598
return bv [ index ] . webContents . getURL ( )
579
599
} )
600
+ ipcMain . handle ( 'cssPath' , ( ) => {
601
+ return app . getPath ( 'userData' )
602
+ } )
580
603
ipcMain . handle ( 'openCustomCSS' , ( ) => {
581
- if ( fs . existsSync ( path . join ( app . getPath ( 'userData' ) , 'custom.css' ) ) ) {
582
- shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom.css' ) )
583
- } else {
584
- fs . writeFile (
585
- path . join ( app . getPath ( 'userData' ) , 'custom.css' ) ,
586
- `/*
587
- This is a CSS file to customize Reamix.
588
- It is applied to tabs and icons and not to pages such as settings.
589
- */`
590
- )
591
- shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom.css' ) )
592
- }
604
+ shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom.css' ) )
593
605
} )
594
606
ipcMain . handle ( 'openCustomSettingCSS' , ( ) => {
595
- if ( fs . existsSync ( path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) ) ) {
596
- shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) )
597
- } else {
598
- fs . writeFile (
599
- path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) ,
600
- `/*
601
- This is a CSS file to customize Reamix.
602
- It is applied to tabs and icons and not to pages such as settings.
603
- */`
604
- )
605
- shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) )
606
- }
607
+ shell . openPath ( path . join ( app . getPath ( 'userData' ) , 'custom_setting.css' ) )
607
608
} )
608
609
ipcMain . handle ( 'moveToNewTab' , ( e , index ) => {
609
610
bv [ index ] . webContents . loadFile ( `${ __dirname } /src/pages/home.html` )
0 commit comments