Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr committed Aug 22, 2024
1 parent c624f30 commit 03fbeca
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 109 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ jobs:
run: |
npm run test
#- name: "Push Artifacts"
# uses: cssnr/push-artifacts-action@master
# with:
# source: "tests/screenshots/"
# dest: "/static"
# host: ${{ secrets.RSYNC_HOST }}
# user: ${{ secrets.RSYNC_USER }}
# pass: ${{ secrets.RSYNC_PASS }}
# port: ${{ secrets.RSYNC_PORT }}
# webhost: "https://artifacts.hosted-domains.com"
# webhook: ${{ secrets.DISCORD_WEBHOOK }}
# token: ${{ secrets.GITHUB_TOKEN }}
- name: "Push Artifacts"
uses: cssnr/push-artifacts-action@master
with:
source: "tests/screenshots/"
dest: "/static"
host: ${{ secrets.RSYNC_HOST }}
user: ${{ secrets.RSYNC_USER }}
pass: ${{ secrets.RSYNC_PASS }}
port: ${{ secrets.RSYNC_PORT }}
webhost: "https://artifacts.hosted-domains.com"
webhook: ${{ secrets.DISCORD_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@

# Cache Cleaner

Modern Chrome Web Extension and Firefox Browser Addon to easily clean cache and optionally reload for specific sites
with a single key press, from the right-click context menu or via the toolbar icon popup.
Modern Chrome Web Extension and Firefox Browser Addon to easily clean selected cache items specific sites or the whole
browser with a single key press, from the right-click context menu or via the toolbar icon popup.

Firefox does not have an API to clear cache storage, the cache created by service workers. Furthermore, it has no
option to bypass the service worker for network when testing. This extension resolves that issue by using a custom
function to clear cache storage when clearing site cache plus has an option automatically reload the page after clearing
function to clear **Cache Storage** when clearing site cache plus has an option automatically reload the page after
clearing
the cache. Now after making a change to a site with a service worker, all you have to do is press `F4` (default keybind
to clear cache) to clear the cache and refresh the site. Additionally, the browsing data API differs on Firefox and
Chrome so logic was added to allow the extension to run on both browsers.
Expand Down Expand Up @@ -61,7 +62,7 @@ the [Chrome Web Store](https://chromewebstore.google.com/detail/cache-cleaner/xx
- Choose which cache items to clear or clear all data
- Clear cache for a specific site or the whole browser
- Option to clear **Cache Storage** in Firefox for individual sites
- Works in both Firefox and Chrome based browsers
- Works in both Firefox and Chromium based browsers

### Upcoming Features

Expand Down Expand Up @@ -101,7 +102,7 @@ If you are experiencing an issue/bug or getting unexpected results, you can:

- Report an Issue: https://github.com/cssnr/cache-cleaner/issues
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
- Provide General Feedback: https://cssnr.github.io/feedback
- Provide General Feedback: [https://cssnr.github.io/feedback](https://cssnr.github.io/feedback/?app=Cache%20Cleaner)

Logs can be found inspecting the page (Ctrl+Shift+I), clicking on the Console, and;
Firefox: toggling Debug logs, Chrome: toggling Verbose from levels dropdown.
Expand Down
11 changes: 1 addition & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ gulp.task('bootstrap', () => {
.pipe(gulp.dest('src/dist/bootstrap'))
})

gulp.task('clipboard', () => {
return gulp
.src('node_modules/clipboard/dist/clipboard.min.js')
.pipe(gulp.dest('src/dist/clipboard'))
})

gulp.task('fontawesome', () => {
return gulp
.src(
Expand All @@ -34,7 +28,4 @@ gulp.task('jquery', () => {
.pipe(gulp.dest('src/dist/jquery'))
})

gulp.task(
'default',
gulp.parallel('bootstrap', 'clipboard', 'fontawesome', 'jquery')
)
gulp.task('default', gulp.parallel('bootstrap', 'fontawesome', 'jquery'))
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Cache Cleaner",
"short_name": "Cache Cleaner",
"description": "Easily clear cache for the current site and optionally auto-reload with a single key press, from the popup or with the context menu.",
"description": "Easily clear selected cache items for the current site or whole browser with a single key press, right-click menu, or popup icon.",
"homepage_url": "https://github.com/cssnr/cache-cleaner",
"author": "Shane",
"version": "0.0.1",
Expand Down
69 changes: 15 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"dependencies": {
"@fortawesome/fontawesome-free": "^6.6.0",
"bootstrap": "^5.3.3",
"clipboard": "^2.0.11",
"jquery": "^3.7.1"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@

<script type="text/javascript" src="../dist/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../dist/bootstrap/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="../dist/clipboard/clipboard.min.js"></script>
<script type="module" src="../js/main.js"></script>
<script type="module" src="../js/options.js"></script>

Expand Down
3 changes: 0 additions & 3 deletions src/html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<div class="container-fluid px-2 py-1">

<div class="d-flex flex-row align-items-center">
<!-- <div class="">-->
<!-- <a title="Cache Cleaner" href="homepage_url"><img src="../images/logo32.png" height="32" width="32" alt="Cache Cleaner"></a>-->
<!-- </div>-->
<div class="dropdown">
<a class="nav-link hvr-grow" id="bd-theme-disabled" title="Theme Switcher" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i id="theme-icon" class="fa-solid fa-circle-half-stroke fa-lg" style="min-width: 20px;"></i> <i class="fa-solid fa-caret-down fa-xs mx-1"></i></a>
Expand Down
20 changes: 0 additions & 20 deletions src/js/main.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
// Common JS for Extension Pages

import { showToast } from './export.js'

if (typeof ClipboardJS !== 'undefined') {
const clipboard = new ClipboardJS('[data-clipboard-text]')
clipboard.on('success', function (event) {
// console.debug('clipboard.success:', event)
const text = event.text.trim()
console.debug(`text: "${text}"`)
if (event.trigger.dataset.toast) {
showToast(event.trigger.dataset.toast, 'success')
} else {
showToast('Copied to Clipboard', 'success')
}
})
clipboard.on('error', function (event) {
console.log('%cclipboard.error:', 'color: Red', event)
showToast('Clipboard Copy Failed', 'warning')
})
}

const backToTop = document.getElementById('back-to-top')
if (backToTop) {
window.addEventListener('scroll', debounce(onScroll))
Expand Down
2 changes: 0 additions & 2 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ async function copySupport(event) {
event.preventDefault()
const manifest = chrome.runtime.getManifest()
const { options } = await chrome.storage.sync.get(['options'])
const permissions = await chrome.permissions.getAll()
const result = [
`${manifest.name} - ${manifest.version}`,
navigator.userAgent,
`permissions.origins: ${JSON.stringify(permissions.origins)}`,
`options: ${JSON.stringify(options)}`,
]
await navigator.clipboard.writeText(result.join('\n'))
Expand Down

0 comments on commit 03fbeca

Please sign in to comment.