Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
v9 (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinify committed Feb 17, 2024
1 parent 44bf7aa commit e939f89
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 67 deletions.
2 changes: 1 addition & 1 deletion dist/build.js

Large diffs are not rendered by default.

71 changes: 10 additions & 61 deletions docs/testing/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/handlers/pocketbrowser/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ function formatInput(input: string): string {
input = 'https://google.com/webhp?igu=1'
}

// changes yt links into embed links
if (input.includes('youtube.com/watch?v=')) {
input = input.replace('youtube.com/watch?v=', 'youtube.com/embed/')
}

return input
}

Expand Down
10 changes: 9 additions & 1 deletion src/handlers/pocketbrowser/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { Pen } from '../../penexutils'
import { HandlerDefinition, Proxies } from '../../types'

function switchProxy(url: string) {
;(document.getElementById('pocketbrowseriframe') as HTMLIFrameElement)!.src = atob(url)
url = atob(url)
console.log(url)
// checks if the url is valid
if (!url.startsWith('http')) {
alert('Invalid proxy URL, try using a different website')
return
}

;(document.getElementById('pocketbrowseriframe') as HTMLIFrameElement)!.src = url
}

function Block(content: Pen[]): Pen[] {
Expand Down
4 changes: 4 additions & 0 deletions src/handlers/scripts/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ function runScript(scripturl: string, patch?: string): void {
fetch(scripturl)
.then((response) => response.text())
.then((text) => eval(text))
.catch((error) => {
console.error('Unable to load Script:', error)
alert('Unable to load Script (This is likely due to website restrictions, please try a different website)')
})
}

function Block(content: Pen[]): Pen[] {
Expand Down
9 changes: 6 additions & 3 deletions src/styles/content.less

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/styles/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

.sidebar-button {
width: 16.5vw;
box-sizing: content-box;
height: 1.2em;
margin-bottom: 0.52em;
padding: 0.25vw 1vw;
Expand Down Expand Up @@ -64,6 +65,7 @@

.sidebar-background {
background: @theme;
box-sizing: content-box;
width: 16.5vw;
padding: 0.75vw 0.4vw;
height: 1.2em;
Expand Down
4 changes: 3 additions & 1 deletion src/styles/utils.less
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
}

.rounded-md {
border-radius: 1.4rem;
// fixes some stuff
border-radius: 1.4rem !important;
box-sizing: content-box;
}

.center-content {
Expand Down

0 comments on commit e939f89

Please sign in to comment.