Skip to content

Commit

Permalink
further cleanup, diverse
Browse files Browse the repository at this point in the history
  • Loading branch information
evandor committed Dec 29, 2024
1 parent 31c91c8 commit bef49e6
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 87 deletions.
14 changes: 8 additions & 6 deletions src/app/BrowserApi.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import _ from 'lodash'
import { LocalStorage, uid } from 'quasar'
import { FeatureIdent } from 'src/app/models/FeatureIdent'
import {
CLEANUP_PERIOD_IN_MINUTES,
GITHUB_AUTO_BACKUP,
MONITORING_PERIOD_IN_MINUTES,
} from 'src/boot/constants'
import { CLEANUP_PERIOD_IN_MINUTES, GITHUB_AUTO_BACKUP, MONITORING_PERIOD_IN_MINUTES } from 'src/boot/constants'
import { useCommandExecutor } from 'src/core/services/CommandExecutor'
import { useFeaturesStore } from 'src/features/stores/featuresStore'
import { useRequestsService } from 'src/requests/services/RequestsService'
Expand Down Expand Up @@ -78,11 +74,17 @@ class BrowserApi {

startWebRequestListener() {
console.log(' ...adding WebRequestListener')
chrome.webRequest.onHeadersReceived.addListener(
chrome.webRequest?.onHeadersReceived.addListener(
this.onHeadersReceivedListener,
{ urls: ['*://*/*'], types: ['main_frame'] },
['responseHeaders'],
)
// chrome.webRequest?.onCompleted.addListener(
// (details: any) => {
// console.log('====>', details)
// },
// { urls: ['*://*/*'], types: ['main_frame'] },
// )
}

stopWebRequestListener() {
Expand Down
2 changes: 1 addition & 1 deletion src/content
2 changes: 1 addition & 1 deletion src/core
2 changes: 1 addition & 1 deletion src/pages/SidePanelCollectionsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ const openIndicatorIcon = (stat: any) => {
return stat.open ? 'keyboard_arrow_down' : 'chevron_right'
}
const topLevelSubfolderExist = () => treeData.value?.findIndex((nto: NodeTreeObject) => nto.children.length > 0) >= 0
const topLevelSubfolderExist = () => treeData.value!.findIndex((nto: NodeTreeObject) => nto.children.length > 0) >= 0
</script>

<style lang="scss">
Expand Down
47 changes: 19 additions & 28 deletions src/pages/TabPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<q-toolbar class="text-primary lightgrey">
<div class="row fit">
<q-toolbar-title>
<div class="row justify-start items-baseline">
Tab Info for '{{ selectedTab?.url }}' (for testing purposes)
</div>
<div class="row justify-start items-baseline">Tab Info for '{{ selectedTab?.url }}' (for testing purposes)</div>
</q-toolbar-title>
</div>
</q-toolbar>
Expand All @@ -24,9 +22,8 @@
<div v-if="tab === 'tabdata'">
<div class="q-pa-md q-gutter-sm">
<q-banner rounded
>Tabsets analyses the URLs you track in order to provide you with additional features like
searching and thumbnails. This is the main info about this tab, retrieved when the page was
opened in a tab.
>Tabsets analyses the URLs you track in order to provide you with additional features like searching and
thumbnails. This is the main info about this tab, retrieved when the page was opened in a tab.
</q-banner>
<div class="row items-baseline q-ma-lg">
<div class="col-2">
Expand All @@ -48,8 +45,7 @@
{{ selectedTab?.url }}&nbsp;<q-icon
name="launch"
color="secondary"
@click.stop="NavigationService.openOrCreateTab([selectedTab?.url || ''])"
></q-icon>
@click.stop="NavigationService.openOrCreateTab([selectedTab?.url || ''])"></q-icon>
</div>
</div>
</div>
Expand All @@ -67,8 +63,7 @@
<div
class="col-9 text-subtitle2"
v-if="selectedTab?.longDescription"
v-html="selectedTab?.longDescription"
></div>
v-html="selectedTab?.longDescription"></div>
</div>
<div class="row items-baseline q-ma-lg" v-if="selectedTab?.author">
<div class="col-3 text-subtitle1">Author</div>
Expand Down Expand Up @@ -139,22 +134,22 @@
<q-img :src="thumbnail" width="512px" style="border: 1px solid grey" />
</div>
</div>
<hr />
<div class="row items-baseline q-ma-lg">
<div class="col-12">Not happy with the results?</div>
<div class="col-12">
<q-btn label="Rerun Analysis" @click="analyseTab" />
</div>
<div class="col-12">This will open a new window, analyse the page and close it again.</div>
</div>
<!-- <hr />-->
<!-- <div class="row items-baseline q-ma-lg">-->
<!-- <div class="col-12">Not happy with the results?</div>-->
<!-- <div class="col-12">-->
<!-- <q-btn label="Rerun Analysis" @click="analyseTab" />-->
<!-- </div>-->
<!-- <div class="col-12">This will open a new window, analyse the page and close it again.</div>-->
<!-- </div>-->
</div>
</div>

<div v-else-if="tab === 'request'">
<div class="q-pa-md q-gutter-sm">
<q-banner rounded
>This is a data derived from the request to the tabs content. This data is collected if the
'analyse tabs' feature is active.
>This is a data derived from the request to the tabs content. This data is collected if the 'analyse tabs'
feature is active.
</q-banner>

Status Code: {{ request['statusCode' as keyof object] }}<br /><br />
Expand Down Expand Up @@ -191,9 +186,8 @@
<div v-else-if="tab === 'metalinks'">
<div class="q-pa-md q-gutter-sm">
<q-banner rounded
>This is a data derived from the tab's content link tags. This data is collected if the
'analyse tabs' feature is active. If this does not work as expected, you might have to
refresh or reinstall the tabsets extension.
>This is a data derived from the tab's content link tags. This data is collected if the 'analyse tabs' feature
is active. If this does not work as expected, you might have to refresh or reinstall the tabsets extension.
</q-banner>

<!-- <q-table-->
Expand Down Expand Up @@ -296,8 +290,7 @@
style="font-size: 80%"
:show-length="true"
v-model:data="state.data"
:show-double-quotes="true"
/>
:show-double-quotes="true" />
</div>
</div>
</template>
Expand Down Expand Up @@ -523,9 +516,7 @@ const requestDataLabel = () => 'Request Header (' + requestRows.value.length + '
const metaLinksDataLabel = () => 'Meta Links (' + metaLinkRows.value.length + ')'
const linksDataLabel = () => 'Links (' + Object.keys(linkRows.value || []).length + ')'
const openNameLink = (key: string) =>
NavigationService.openOrCreateTab([
'https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/' + key,
])
NavigationService.openOrCreateTab(['https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/' + key])
const analyseTab = () => {
if (selectedTab.value) {
Expand Down
60 changes: 15 additions & 45 deletions src/pages/sidepanel/SidePanelTabDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@

<div class="row items-baseline q-mx-sm q-my-sm">
<div class="col-2">
<TabFaviconWidget
v-if="tab"
class="q-mr-md q-mb-md"
:tab="tab as Tab"
width="24px"
height="24px"
/>
<TabFaviconWidget v-if="tab" class="q-mr-md q-mb-md" :tab="tab as Tab" width="24px" height="24px" />
</div>
<div class="col-10 text-body1 ellipsis-3">
{{ getHost(tab?.url || '', true) }}
Expand All @@ -36,13 +30,8 @@
<div class="col-12">
<div
class="text-overline ellipsis text-accent cursor-pointer"
@click.stop="NavigationService.openOrCreateTab([tab?.url || ''])"
>
{{ tab?.url }}&nbsp;<q-icon
name="launch"
color="secondary"
class="cursor-pointer"
></q-icon>
@click.stop="NavigationService.openOrCreateTab([tab?.url || ''])">
{{ tab?.url }}&nbsp;<q-icon name="launch" color="secondary" class="cursor-pointer"></q-icon>
</div>
<div class="text-body2 ellipsis">
{{ tab?.id }}
Expand All @@ -59,8 +48,7 @@
size="8px"
clickable
icon="tab"
@click="openTabset(chip)"
>
@click="openTabset(chip)">
{{ chip['label' as keyof object] }}
</q-chip>
</div>
Expand All @@ -73,11 +61,7 @@

<div class="row q-ma-sm">
<div class="col-12" v-if="true">
<q-img
:src="thumbnail"
style="border: 1px dotted grey; border-radius: 5px"
no-native-menu
/>
<q-img :src="thumbnail" style="border: 1px dotted grey; border-radius: 5px" no-native-menu />
</div>
<div class="col-12 bg-amber-1" v-else-if="!inBexMode()">
<!-- <q-img src="thumbnail-not-available.png" style="border:1px solid grey;border-radius: 5px;" no-native-menu/>-->
Expand All @@ -104,8 +88,7 @@
size="11px"
color="primary"
flat
icon="o_more_horiz"
>
icon="o_more_horiz">
<q-tooltip>Show additional information about this tab (developer mode)</q-tooltip>
</q-btn>
</div>
Expand Down Expand Up @@ -137,8 +120,7 @@
input-debounce="0"
new-value-mode="add-unique"
@update:model-value="(val) => updatedTags(val)"
style="width: 250px"
/>
style="width: 250px" />
</q-card-section>
</q-card>
</q-expansion-item>
Expand Down Expand Up @@ -222,18 +204,13 @@
</q-card>
</q-expansion-item>

<q-expansion-item
label="Tab References Status"
group="tabrefgroup"
v-if="tab && tab.tabReferences"
>
<q-expansion-item label="Tab References" group="tabrefgroup" v-if="tab && tab.tabReferences">
<div class="q-ma-sm q-ml-lg" v-for="ref in tab.tabReferences">
<template v-if="ref.type === TabReferenceType.RSS">
<div class="text-caption text-bold">found RSS:</div>
<div class="text-caption text-bold">found RSS ({{ ref.status }}):</div>
<div
class="text-caption ellipsis text-accent cursor-pointer"
@click="useNavigationService().browserTabFor(ref.href || '')"
>
@click="useNavigationService().browserTabFor(ref.href || '')">
{{ ref.href }}
</div>
</template>
Expand Down Expand Up @@ -301,8 +278,7 @@
<li
v-for="p in ref.data"
class="ellipsis"
@click="useNavigationService().browserTabFor(p['parent' as keyof object])"
>
@click="useNavigationService().browserTabFor(p['parent' as keyof object])">
{{ p['parent' as keyof object] }}
</li>
</ul>
Expand Down Expand Up @@ -516,9 +492,7 @@ const formatDate = (timestamp: number | undefined) =>
timestamp ? formatDistance(timestamp, new Date(), { addSuffix: true }) : ''
const showTabDetails = () =>
NavigationService.openOrCreateTab([
chrome.runtime.getURL('/www/index.html#/mainpanel/tab/' + tab.value?.id),
])
NavigationService.openOrCreateTab([chrome.runtime.getURL('/www/index.html#/mainpanel/tab/' + tab.value?.id)])
const updatedTags = (val: string[]) => {
console.log('val', val)
Expand All @@ -539,8 +513,7 @@ const openTabset = (chip: any) => {
const openInJsonCrackEditor = (data: string) => {
$q.dialog({
title: 'Open in external Editor?',
message:
'The current JSON-LD Data will be copied to your clipboard to be added by you to the external editor',
message: 'The current JSON-LD Data will be copied to your clipboard to be added by you to the external editor',
cancel: true,
persistent: true,
}).onOk(() => {
Expand All @@ -551,7 +524,7 @@ const openInJsonCrackEditor = (data: string) => {
}
const linkingHeading = (data: object | undefined) => {
console.log('data', data)
//console.log('data', data)
if (!data) {
return '---'
}
Expand All @@ -560,10 +533,7 @@ const linkingHeading = (data: object | undefined) => {
const openSearch = () => {
useNavigationService().browserTabFor(
'https://github.com/search?q={searchTerms}&amp;ref=opensearch'.replace(
'{searchTerms}',
opensearchterm.value || '',
),
'https://github.com/search?q={searchTerms}&amp;ref=opensearch'.replace('{searchTerms}', opensearchterm.value || ''),
)
}
</script>
4 changes: 2 additions & 2 deletions src/pages/sidepanel/helper/FirstToolbarHelper2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<q-toolbar class="q-pa-none q-pl-none q-pr-none q-pb-none greyBorderBottom" :style="offsetTop()">
<q-toolbar-title>
<div class="row q-ma-none q-pa-none">
<div class="col-7 q-ma-none q-pa-none" style="border: 0 solid red">
<div class="col-6 q-ma-none q-pa-none" style="border: 0 solid red">
<!-- no spaces && searching -->
<SearchWithTransitionHelper
v-if="searching"
Expand Down Expand Up @@ -49,7 +49,7 @@
</div>

<div
class="col-5 text-subtitle1 text-right q-ma-none q-pa-none q-pr-none"
class="col-6 text-subtitle1 text-right q-ma-none q-pa-none q-pr-none"
v-if="!useUiStore().appLoading"
style="border: 0 solid green">
<slot name="iconsRight">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="text-caption">{{ title() }}</div>
</template>
<div class="text-body1 text-bold cursor-pointer" @click="router.push('/sidepanel')">
{{ currentTabset.name }}
{{ currentTabset?.name }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/spaces

0 comments on commit bef49e6

Please sign in to comment.