Skip to content

Commit 5709d6d

Browse files
brdlyptrsDSergiu
andauthored
fix(script): Add anonymous as default value for crossOrigin (#39)
Co-authored-by: Sergiu D. <danalachisergiu@gmail.com> Co-authored-by: Sergiu Danalachi <danalachi.sergiu@gmail.com>
1 parent 90bff0b commit 5709d6d

7 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/actions/playwright/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ runs:
2121
- name: Setup playwright
2222
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
2323
shell: bash
24-
run: npx playwright install --with-deps
24+
run: npx playwright install --with-deps

.github/actions/setup/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ runs:
99
- name: Install dependencies
1010
uses: ./.github/actions/dependencies
1111
- name: Install playwright browsers
12-
uses: ./.github/actions/playwright
12+
uses: ./.github/actions/playwright

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.16
1+
v20.13

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const { response } = await hcaptcha.execute({ async: true });
3838
|-------------------|-------------|----------|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
3939
| `loadAsync` | Boolean | No | `true` | Set if the script should be loaded asynchronously. |
4040
| `cleanup` | Boolean | No | `true` | Remove script tag after setup. |
41-
| `crossOrigin` | String | No | `-` | Set script cross origin attribute such as "anonymous". |
41+
| `crossOrigin` | String | No | `anonymous` | Set script cross origin attribute such as "anonymous". |
4242
| `scriptSource` | String | No | `https://js.hcaptcha.com/1/api.js` | Set script source URI. Takes precedence over `secureApi`. |
4343
| `scriptLocation` | HTMLElement | No | `document.head` | Location of where to append the script tag. Make sure to add it to an area that will persist to prevent loading multiple times in the same document view. |
4444
| `secureApi` | Boolean | No | `false` | See enterprise docs. |

lib/__test__/script.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ describe('fetchScript', () => {
110110
const [script] = nodes;
111111
expect(script.src).toMatch('https://js.hcaptcha.com/1/api.js');
112112
expect(script.async).toBeTruthy();
113+
expect(script.crossOrigin).toEqual('anonymous');
113114
expect(script.id).toEqual(SCRIPT_ID);
114115
});
115116

lib/src/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function fetchScript({
77
scriptLocation,
88
query,
99
loadAsync = true,
10-
crossOrigin,
10+
crossOrigin = 'anonymous',
1111
apihost = 'https://js.hcaptcha.com',
1212
cleanup = true,
1313
secureApi = false,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hcaptcha/loader",
33
"description": "This is a JavaScript library to easily configure the loading of the hCaptcha JS client SDK with built-in error handling.",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"author": "hCaptcha team and contributors",
66
"license": "MIT",
77
"keywords": [

0 commit comments

Comments
 (0)