File tree Expand file tree Collapse file tree 6 files changed +18
-3
lines changed
Expand file tree Collapse file tree 6 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 55 < meta charset ="utf-8 ">
66 < title > Access to the site is limited</ title >
77 < link href ="style/block.css " rel ="stylesheet " />
8+ < script src ="scripts/block.js "> </ script >
89</ head >
910
1011< body >
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ function backgroundCheck() {
3838 activity . setCurrentActiveTab ( tab . url ) ;
3939 chrome . idle . queryState ( parseInt ( setting_interval_inactivity ) , function ( state ) {
4040 if ( state === 'active' ) {
41- if ( activity . isLimitExceeded ( activeUrl , tab ) ) {
42- chrome . tabs . create ( { url : chrome . runtime . getURL ( "block.html" ) } )
41+ if ( activity . isLimitExceeded ( activeUrl , tab ) ) {
42+ setBlockPageToCurrent ( activeUrl ) ;
4343 }
4444 if ( ! activity . isInBlackList ( activeUrl ) )
4545 tab . incSummaryTime ( ) ;
@@ -82,6 +82,13 @@ function backgroundCheck() {
8282 } ) ;
8383}
8484
85+ function setBlockPageToCurrent ( activeUrl ) {
86+ var blockUrl = chrome . runtime . getURL ( "block.html" ) + '?url=' + activeUrl ;
87+ chrome . tabs . query ( { currentWindow : true , active : true } , function ( tab ) {
88+ chrome . tabs . update ( tab . id , { url : blockUrl } ) ;
89+ } ) ;
90+ }
91+
8592function backgroundUpdateStorage ( ) {
8693 if ( tabs != undefined && tabs . length > 0 )
8794 storage . saveTabs ( tabs ) ;
Original file line number Diff line number Diff line change 1+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
2+ var url = new URL ( document . URL ) ;
3+ var blockSiteUrl = url . searchParams . get ( "url" ) ;
4+ document . getElementById ( 'site' ) . innerText = blockSiteUrl ;
5+ } ) ;
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ function convertTimeToSummaryTime(time) {
5858 var min = timeValue [ 1 ] ;
5959 var resultTimeValue = 0 ;
6060 if ( hour > 0 )
61- resultTimeValue = hour * 60 * 3600 ;
61+ resultTimeValue = hour * 3600 ;
6262 resultTimeValue += min * 60 ;
6363
6464 return resultTimeValue ;
Original file line number Diff line number Diff line change 1616
1717.current-site {
1818 font-weight : 500 ;
19+ color : rgb (202 , 48 , 48 );
1920}
Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ input[type="button"]:hover {
318318
319319.restriction-item {
320320 width : 380px ;
321+ font-weight : 600 ;
321322}
322323
323324.notify .warning {
You can’t perform that action at this time.
0 commit comments