File tree Expand file tree Collapse file tree 8 files changed +273
-219
lines changed
Expand file tree Collapse file tree 8 files changed +273
-219
lines changed Original file line number Diff line number Diff line change 1010 "start" : " web-ext run" ,
1111 "nightly" : " web-ext run --firefox=/home/esmail/software/firefox_nightly/firefox" ,
1212 "start_ar" : " web-ext run --firefox=/home/esmail/software/firefox_ar/firefox" ,
13- "android" : " web-ext run -t firefox-android --adb-device emulator-5554 --firefox-apk org.mozilla.fenix " ,
13+ "android" : " web-ext run -t firefox-android --adb-device emulator-5554 --firefox-apk org.mozilla.firefox --adb-remove-old-artifacts " ,
1414 "build" : " web-ext build" ,
1515 "test" : " web-ext lint" ,
1616 "html" : " rollup -c --config-popup && rollup -c --config-options"
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 11<script >
22 export let checked
33 export let onChange
4- console .log (document .body .dir )
54 </script >
65
76<input class ={document .body .dir } {...$$restProps } bind:checked on:change ={onChange } type =" checkbox" />
Original file line number Diff line number Diff line change 1414 const unsubscribe = options .subscribe (val => (_options = val))
1515 onDestroy (unsubscribe)
1616
17+ let disableBookmarks = null
18+ browser .runtime .getPlatformInfo (r => {
19+ switch (r .os ) {
20+ case " fuchsia" :
21+ case " ios" :
22+ case " android" :
23+ disableBookmarks = true
24+ break
25+ default :
26+ disableBookmarks = false
27+ }
28+ if (! disableBookmarks) {
29+ browser .permissions .contains ({ permissions: [" bookmarks" ] }, r => (bookmarksPermission = r))
30+ }
31+ })
32+
1733 let bookmarksPermission
18- browser .permissions .contains ({ permissions: [" bookmarks" ] }, r => (bookmarksPermission = r))
19- $: if (bookmarksPermission) {
20- browser .permissions .request ({ permissions: [" bookmarks" ] }, r => (bookmarksPermission = r))
21- } else {
22- browser .permissions .remove ({ permissions: [" bookmarks" ] })
23- bookmarksPermission = false
34+ $: if (disableBookmarks !== null && disableBookmarks === false ) {
35+ if (bookmarksPermission) {
36+ browser .permissions .request ({ permissions: [" bookmarks" ] }, r => (bookmarksPermission = r))
37+ } else {
38+ browser .permissions .remove ({ permissions: [" bookmarks" ] })
39+ bookmarksPermission = false
40+ }
2441 }
2542 </script >
2643
6885 />
6986 </Row >
7087
71- <Row >
72- <Label >{browser .i18n .getMessage (" bookmarksMenu" ) || " Bookmarks menu" }</Label >
73- <Checkbox bind:checked ={bookmarksPermission } />
74- </Row >
88+ {#if disableBookmarks === false }
89+ <Row >
90+ <Label >{browser .i18n .getMessage (" bookmarksMenu" ) || " Bookmarks menu" }</Label >
91+ <Checkbox bind:checked ={bookmarksPermission } />
92+ </Row >
93+ {/if }
7594
7695 <Exceptions />
7796
Original file line number Diff line number Diff line change 5959 async function pingInstances () {
6060 pingCache = {}
6161 for (const instance of allInstances) {
62- console .log (" pinging..." , instance)
6362 pingCache[instance] = { color: " lightblue" , value: " pinging..." }
6463 const time = await utils .ping (instance)
6564 pingCache[instance] = colorTime (time)
Original file line number Diff line number Diff line change 3232<div >
3333 <Row >
3434 <Label >
35- Service:
36- <a href ={serviceConf .url } target ="_blank" rel ="noopener noreferrer" >{serviceConf .url }</a >
35+ <a href ={serviceConf .url } style =" text-decoration: underline;" target =" _blank" rel =" noopener noreferrer" >
36+ {browser .i18n .getMessage (" service" ) || " Service" }
37+ </a >
3738 </Label >
3839 <div dir =" ltr" >
3940 <SvelteSelect
9192
9293 <Row >
9394 <Label >
94- {browser .i18n .getMessage (" frontend" ) || " Frontend" }:
95- <a href ={frontendWebsite } target =" _blank" rel =" noopener noreferrer" >
96- {frontendWebsite }
95+ <a href ={frontendWebsite } style =" text-decoration: underline;" target =" _blank" rel =" noopener noreferrer" >
96+ {browser .i18n .getMessage (" frontend" ) || " Frontend" }
9797 </a >
9898 </Label >
9999 <div dir =" ltr" >
Original file line number Diff line number Diff line change 4141
4242<div class ={document .body .dir }>
4343 {#if redirect }
44- <Row class ="interactive" on:click ={() => browser .runtime .sendMessage (" redirectTab" )}>
44+ <Row
45+ class =" interactive"
46+ on:click ={() => {
47+ browser .runtime .sendMessage (" redirectTab" , () => {
48+ window .close ()
49+ })
50+ }}
51+ >
4552 <Label >{browser .i18n .getMessage (" redirect" ) || " Redirect" }</Label >
4653 <RedirectIcon />
4754 </Row >
5057 {#if switchInstance }
5158 <Row
5259 class =" interactive"
53- on:click ={async () => browser .tabs .update ({ url: await servicesHelper .switchInstance (url ) })}
60+ on:click ={async () =>
61+ browser .tabs .update ({ url: await servicesHelper .switchInstance (url ) }, () => {
62+ window .close ()
63+ })}
5464 >
5565 <Label >{browser .i18n .getMessage (" switchInstance" ) || " Switch Instance" }</Label >
5666 <SwitchInstanceIcon />
6272 <Label >{browser .i18n .getMessage (" copyOriginal" ) || " Copy Original" }</Label >
6373 <CopyIcon />
6474 </Row >
65- <Row class ="interactive" on:click ={() => browser .runtime .sendMessage (" reverseTab" )}>
75+ <Row
76+ class =" interactive"
77+ on:click ={() =>
78+ browser .runtime .sendMessage (" reverseTab" , () => {
79+ window .close ()
80+ })}
81+ >
6682 <Label >{browser .i18n .getMessage (" redirectToOriginal" || " Redirect to Original" )}</Label >
6783 <RedirectToOriginalIcon />
6884 </Row >
85101
86102 <hr />
87103
88- <Row class ="interactive" on:click ={() => window .open (browser .runtime .getURL (" pages/options/index.html" ), " _blank" )}>
104+ <Row
105+ class =" interactive"
106+ on:click ={() =>
107+ browser .tabs .create ({ url: browser .runtime .getURL (" pages/options/index.html" ) }, () => {
108+ window .close ()
109+ })}
110+ >
89111 <Label >{browser .i18n .getMessage (" settings" )}</Label >
90112 <SettingsIcon />
91113 </Row >
Original file line number Diff line number Diff line change 2828 <div
2929 class =" interactive"
3030 on:keydown ={null }
31- on:click ={() => window .open (browser .runtime .getURL (_config .services [serviceKey ].url ), " _blank" )}
31+ on:click ={() =>
32+ browser .tabs .create ({ url: browser .runtime .getURL (_config .services [serviceKey ].url ) }, () => {
33+ window .close ()
34+ })}
3235 >
3336 <ServiceIcon details ={{ value : serviceKey , label : _config .services [serviceKey ].name }} />
3437 <Label >{_config .services [serviceKey ].name }</Label >
You can’t perform that action at this time.
0 commit comments