Skip to content

Commit

Permalink
Remove Premium Access
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecaret committed Dec 17, 2023
1 parent c7ff352 commit fd96763
Show file tree
Hide file tree
Showing 59 changed files with 638 additions and 2,949 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
parserOptions: {
ecmaVersion: 'latest',
},
ignorePatterns: ['src/assets/ExtPay.js'],
rules: {
'vue/require-default-prop': 'off',
'vue/multi-word-component-names': 'off',
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Ignore third party libraries:
src/assets/ExtPay.js
# Ignore third party libraries:
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"scss.validate": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ For help or feature suggestions visit the [CaretTab Support page](https://carett
- **Storage**: Used to store your settings in the browser's storage area.
- **Replace the page you see when opening a new tab**: Used to replace the New Tab page with this extension.
- **This extension can read and change your data on sites**: The sites listed with this permission are used to retrieve data for CaretTab to function.
- **https://extensionpay.com/***: This is the payment provider CaretTab users. It is required to allow payments for Premium Access to work.
- **https://fonts.googleapis.com/***: The fonts available in the extension are from Google Fonts; this URL is where the fonts are loaded from.
- **https://dtfv5mvrx9.execute-api.us-west-2.amazonaws.com/***: This is an Amazon Web Services server that CaretTab accesses to retrieve various data such us API access for weather among other data. Data is only ever retrieved from this address, never sent.
- (Optional) **https://developer.sepush.co.za/***: Used to retrieve data for the Loadshedding widget.
Expand Down
4 changes: 0 additions & 4 deletions import-ExtPay.js

This file was deleted.

17 changes: 2 additions & 15 deletions manifest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const getManifestSettings = (env) => {
short_name: 'CaretTab',
name: env.mode === 'beta' ? 'CaretTab BETA' : '__MSG_appName__',
description: env.mode === 'beta' ? 'Beta version of the New Tab extension, CaretTab' : '__MSG_appDesc__',
version: `4.3.0`,
version_name: `4.3.0`,
version: `4.4.0`,
version_name: `4.4.0`,
default_locale: 'en',
icons: {
16: 'img/icon16.png',
Expand All @@ -17,13 +17,6 @@ const getManifestSettings = (env) => {
chrome_url_overrides: {
newtab: 'index.html',
},
content_scripts: [
{
matches: ['https://extensionpay.com/*'],
js: ['import-ExtPay.js'],
run_at: 'document_start',
},
],
background: {
service_worker: 'src/service_worker.js',
type: 'module',
Expand Down Expand Up @@ -73,12 +66,6 @@ const getManifestSettings = (env) => {
description: 'Load Quick Link 9',
},
},
web_accessible_resources: [
{
resources: ['src/assets/ExtPay.js'],
matches: ['https://extensionpay.com/*'],
},
],
}

return baseManifest
Expand Down
41 changes: 13 additions & 28 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
<script setup>
import { useI18n } from 'vue-i18n'
import { computed, onMounted, inject, watch } from 'vue'
import { computed, onMounted, watch } from 'vue'
import { useSettingsStore, getStorage, setStorage } from '@/store.js'
import { storeToRefs } from 'pinia'
import NewTab from '@/components/NewTab.vue'
import SettingsPanel from '@/components/settings/SettingsPanel.vue'
import LoadingOverlay from '@/components/elements/LoadingOverlay.vue'
import { fontList } from '@/assets/lists.js'
import { ExtPay } from '@/assets/ExtPay.js'
import { checkVersionInRange } from '@/helpers/data.js'
import { mergeV3Settings } from '@/helpers/mergeOldSettings.js'
import PremiumModal from '@/components/elements/PremiumModal.vue'
const { locale } = useI18n({ useScope: 'global' })
const extpay = ExtPay('carettab')
const updateUser = inject('updateUser')
const store = useSettingsStore()
const { isLoading, settingsOpen } = storeToRefs(store)
onMounted(async () => {
await store.load()
setupTempSettings()
refreshUserCheck()
if (store.status === 'updated' && checkVersionInRange(store.prevVersion, '3.X.X')) {
mergeV3Settings()
}
// If status is still set to installed, but there are already layers,
// this is probably incorrect and needs changed to existing.
if (store.status === 'installed' && store.config.layers?.length > 0) {
store.status = 'existing'
setStorage({ status: 'existing' }, 'local')
}
applyUserColorSchemePreference()
})
Expand Down Expand Up @@ -73,27 +80,6 @@ const setupTempSettings = async () => {
store.clearWhatsNewBox = whatsNew.clearWhatsNewBox
}
// Run a full user check against the server now that the app has loaded
const refreshUserCheck = async () => {
try {
const getUser = await extpay.getUser()
updateUser({ ...getUser })
} catch (error) {
console.warn('Failed to check extensionPay user', error)
}
// after checking paid status, run v3 migration
if (store.status === 'updated' && checkVersionInRange(store.prevVersion, '3.X.X')) {
mergeV3Settings()
}
// If status is still set to installed, but there are already layers,
// this is probably incorrect and needs changed to existing.
if (store.status === 'installed' && store.config.layers?.length > 0) {
store.status = 'existing'
setStorage({ status: 'existing' }, 'local')
}
}
const updateTime = () => {
store.currentTime = new Date()
setInterval(() => {
Expand Down Expand Up @@ -137,7 +123,6 @@ const getFontFamily = computed(() => {
<NewTab></NewTab>
<SettingsPanel v-if="settingsOpen"></SettingsPanel>
<div id="modals"></div>
<PremiumModal />
<div id="dropdowns"></div>
<LoadingOverlay v-if="isLoading"></LoadingOverlay>
</div>
Expand Down
Loading

0 comments on commit fd96763

Please sign in to comment.