Skip to content

Commit

Permalink
Showing 11 changed files with 38 additions and 25 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/pre-release-build.yml
Original file line number Diff line number Diff line change
@@ -3,14 +3,18 @@ on:
workflow_dispatch:
# push:
# branches:
# - main
# - master
# paths:
# - "src/**"
# - "!src/**/*.json"
# - "build.mjs"
# tags-ignore:
# - "v*"

permissions:
id-token: "write"
contents: "write"

jobs:
build_and_release:
runs-on: ubuntu-22.04
7 changes: 6 additions & 1 deletion .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ on:
tags:
- "v*"

permissions:
id-token: "write"
contents: "write"

jobs:
build_and_release:
runs-on: macos-12
@@ -12,7 +16,7 @@ jobs:
- run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: main
ref: master

- name: Update manifest.json version
uses: jossef/[email protected]
@@ -29,6 +33,7 @@ jobs:
value: ${{ env.VERSION }}

- name: Push files
continue-on-error: true
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "chat-gpt-search-engine-extension",
"name": "chatgptbox",
"scripts": {
"build": "node build.mjs --production",
"build:safari": "bash ./safari/build.sh",
4 changes: 2 additions & 2 deletions safari/appdmg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "chatGPT for Search Engine",
"title": "ChatGPTBox",
"icon": "../src/logo.png",
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "../build/chatGPT-for-Search-Engine.app" }
{ "x": 192, "y": 344, "type": "file", "path": "../build/chatGPTBox.app" }
]
}
10 changes: 5 additions & 5 deletions safari/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
xcrun safari-web-extension-converter ./build/firefox \
--project-location ./build/safari --app-name chatGPT-for-Search-Engine \
--bundle-identifier dev.josStorer.chatGPT-for-Search-Engine --force --no-prompt --no-open
--project-location ./build/safari --app-name chatGPTBox \
--bundle-identifier dev.josStorer.chatGPTBox --force --no-prompt --no-open
git apply safari/project.patch
xcodebuild archive -project ./build/safari/chatGPT-for-Search-Engine/chatGPT-for-Search-Engine.xcodeproj \
-scheme "chatGPT-for-Search-Engine (macOS)" -configuration Release -archivePath ./build/safari/chatGPT-for-Search-Engine.xcarchive
xcodebuild -exportArchive -archivePath ./build/safari/chatGPT-for-Search-Engine.xcarchive \
xcodebuild archive -project ./build/safari/chatGPTBox/chatGPTBox.xcodeproj \
-scheme "chatGPTBox (macOS)" -configuration Release -archivePath ./build/safari/chatGPTBox.xcarchive
xcodebuild -exportArchive -archivePath ./build/safari/chatGPTBox.xcarchive \
-exportOptionsPlist ./safari/export-options.plist -exportPath ./build
npm install -D appdmg
rm ./build/safari.dmg
8 changes: 4 additions & 4 deletions safari/project.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- a/build/safari/chatGPT-for-Search-Engine/chatGPT-for-Search-Engine.xcodeproj/project.pbxproj
+++ b/build/safari/chatGPT-for-Search-Engine/chatGPT-for-Search-Engine.xcodeproj/project.pbxproj
--- a/build/safari/chatGPTBox/chatGPTBox.xcodeproj/project.pbxproj
+++ b/build/safari/chatGPTBox/chatGPTBox.xcodeproj/project.pbxproj
@@ -825,7 +825,7 @@
"@executable_path/../../../../Frameworks",
);
@@ -19,11 +19,11 @@
+ );
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "macOS (App)/chatGPT-for-Search-Engine.entitlements";
CODE_SIGN_ENTITLEMENTS = "macOS (App)/chatGPTBox.entitlements";
@@ -887,6 +891,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "macOS (App)/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "chatGPT-for-Search-Engine";
INFOPLIST_KEY_CFBundleDisplayName = "chatGPTBox";
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
8 changes: 6 additions & 2 deletions src/content-script/site-adapters/youtube/index.mjs
Original file line number Diff line number Diff line change
@@ -24,14 +24,18 @@ export default {
})
).text()

let subtitleUrl = docText.substring(docText.indexOf('https://www.youtube.com/api/timedtext'))
const subtitleUrlStartAt = docText.indexOf('https://www.youtube.com/api/timedtext')
if (subtitleUrlStartAt === -1) return

let subtitleUrl = docText.substring(subtitleUrlStartAt)
subtitleUrl = subtitleUrl.substring(0, subtitleUrl.indexOf('"'))
subtitleUrl = subtitleUrl.replaceAll('\\u0026', '&')

let title = docText.substring(docText.indexOf('"title":"') + '"title":"'.length)
title = title.substring(0, title.indexOf('","'))

const subtitleResponse = await fetch(subtitleUrl)
if (!subtitleResponse.ok) return
let subtitleData = await subtitleResponse.text()

let subtitleContent = ''
@@ -44,7 +48,7 @@ export default {

return cropText(
`Provide a brief summary of the video using concise language and incorporating the video title.` +
`The video title is:"${title}".The subtitle content is as follows:\n${subtitleContent}`,
`The video title is:"${title}".The subtitle content is as follows:\n${subtitleContent}`,
)
} catch (e) {
console.log(e)
6 changes: 3 additions & 3 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Search Engine",
"description": "Display ChatGPT response alongside Search Engine results",
"version": "1.26.1",
"name": "ChatGPTBox",
"description": "Integrating ChatGPT into your browser deeply, everything you need is here",
"version": "2.0.0",
"manifest_version": 3,
"icons": {
"16": "logo.png",
6 changes: 3 additions & 3 deletions src/manifest.v2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Search Engine",
"description": "Display ChatGPT response alongside Search Engine results",
"version": "1.26.1",
"name": "ChatGPTBox",
"description": "Integrating ChatGPT into your browser deeply, everything you need is here",
"version": "2.0.0",
"manifest_version": 2,
"icons": {
"16": "logo.png",
2 changes: 1 addition & 1 deletion src/popup/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>ChatGPT for Search Engine</title>
<title>ChatGPTBox</title>
<link rel="stylesheet" href="popup.css" />
<meta charset="UTF-8">
</head>

0 comments on commit f9ef962

Please sign in to comment.