File tree Expand file tree Collapse file tree 5 files changed +34
-1
lines changed
Expand file tree Collapse file tree 5 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1+ export function extractHostname ( url :string | undefined ) :string {
2+ let hostname ;
3+ if ( url == undefined ) return '' ;
4+
5+ if ( url . indexOf ( "//" ) > - 1 ) {
6+ hostname = url . split ( '/' ) [ 2 ] ;
7+ }
8+ else {
9+ hostname = url . split ( '/' ) [ 0 ] ;
10+ }
11+
12+ hostname = hostname . split ( ':' ) [ 0 ] ;
13+ hostname = hostname . split ( '?' ) [ 0 ] ;
14+
15+ return hostname ;
16+ }
Original file line number Diff line number Diff line change 1+ import Browser from 'webextension-polyfill' ;
2+
3+ export function isValidPage ( tab : Browser . Tabs . Tab ) : boolean {
4+ if ( tab == null || tab == undefined || ! tab . url ) return false ;
5+
6+ if ( ( tab . url . indexOf ( 'http:' ) == - 1 && tab . url . indexOf ( 'https:' ) == - 1 )
7+ || tab . url . indexOf ( 'chrome://' ) !== - 1
8+ || tab . url . indexOf ( 'chrome-extension://' ) !== - 1 )
9+ return false ;
10+ return true ;
11+ }
Original file line number Diff line number Diff line change 1+ import { LocalStorage } from "./local-storage" ;
2+ import { IStorage } from "./storage-interface" ;
3+
4+ export function injecStorage ( ) : IStorage {
5+ return new LocalStorage ( ) ;
6+ }
Original file line number Diff line number Diff line change 1- import { IStorage } from "./storage" ;
1+ import { IStorage } from "./storage-interface " ;
22import { StorageParams } from "./storage-params" ;
33import { Tab } from "./tab" ;
44import Browser from 'webextension-polyfill' ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments