-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vtempest
committed
Oct 16, 2024
1 parent
25ed696
commit 15d9939
Showing
64 changed files
with
2,166 additions
and
945 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Auto-Green | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
log: | ||
description: "Commit Log" | ||
required: true | ||
default: "a commit a day keeps your girlfriend away" | ||
schedule: | ||
- cron: "0 0 * * 0-5" | ||
|
||
jobs: | ||
autogreen: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Pull | ||
run: | | ||
git config --local user.name "${{ github.actor }}" | ||
git config --local user.email "${{ github.actor }}@gmail.com" | ||
git remote set-url origin https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
git pull --rebase | ||
- name: Commit (default) | ||
if: github.event.inputs.log == 0 | ||
run: git commit --allow-empty -m "a commit a day keeps your girlfriend away" | ||
|
||
- name: Commit (input) | ||
if: github.event.inputs.log != 0 | ||
run: git commit --allow-empty -m "${{ github.event.inputs.log }}" | ||
|
||
- name: Push | ||
run: git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* <b>Allow CORS - Chrome Extension API.</b> Add (Access-Control-Allow-Origin: *) rule to the response | ||
* header of all requests to enable cross-domain requests to scrape data from other domains. | ||
* CORS is voluntarily enforced by browser frontends, but not by curl or backend | ||
* requests. Allowing CORS on the front-end means no proxy server is needed and web apps | ||
* have Browser App functionality and can turn any data into an API. | ||
* [There are several extension enabling CORS.](https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf?) | ||
* It is suggested to allow only on specific initiator domains to prevent errors | ||
* commonly caused on secure sites like Claude.ai. Needs [Chrome API | ||
* "permissions"](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest):[ "declarativeNetRequest"] | ||
* | ||
* * @param {string[]} initiatorDomains - The domains allowed to initiate CORS request | ||
* @param {string} receivingDomains - The domains allowed to receive the request | ||
* @returns {void} | ||
* @category Chrome Extension | ||
* @example chrome.runtime.onInstalled.addListener(() => { | ||
modifyChromeAPIAllowCORS(["qwksearch.com"]); | ||
}); | ||
*/ | ||
export function modifyChromeAPIAllowCORS( | ||
initiatorDomains = "*://*/*", | ||
receivingDomains = "*" | ||
) { | ||
return chrome?.declarativeNetRequest?.updateDynamicRules({ | ||
removeRuleIds: [1], | ||
addRules: [ | ||
{ | ||
id: 1, | ||
priority: 1, | ||
action: { | ||
type: "modifyHeaders", | ||
responseHeaders: [ | ||
{ | ||
header: "Access-Control-Allow-Origin", | ||
operation: "set", | ||
value: "*", | ||
}, | ||
{ | ||
header: "Access-Control-Allow-Methods", | ||
operation: "set", | ||
value: "GET, POST, OPTIONS, PUT, DELETE, PATCH", | ||
}, | ||
], | ||
}, | ||
condition: { | ||
urlFilter: receivingDomains, | ||
initiatorDomains, | ||
resourceTypes: [ | ||
"main_frame", | ||
"sub_frame", | ||
"stylesheet", | ||
"script", | ||
"image", | ||
"font", | ||
"object", | ||
"xmlhttprequest", | ||
"ping", | ||
"csp_report", | ||
"media", | ||
"websocket", | ||
"other", | ||
], | ||
}, | ||
}, | ||
], | ||
}); | ||
} | ||
|
Oops, something went wrong.