Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: nuxt-scripts integration #306

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

huang-julien
Copy link
Contributor

Hi 馃憢

This PR implements @nuxt/scripts for nuxt >= 3.11.1 (we'll see if we remove the compatibility field in @nuxt/scripts)

Copy link
Contributor Author

@huang-julien huang-julien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why 'to wait for error logs' is failing. I can't retireve any log.

package.json Outdated Show resolved Hide resolved
src/module.ts Outdated Show resolved Hide resolved
@huang-julien huang-julien marked this pull request as draft April 14, 2024 13:28
Comment on lines 30 to +35
urls
.map(url => url.toString())
.includes(
'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback',
),
// look for the challenge platform iframe
'https://challenges.cloudflare.com/cdn-cgi/challenge-platform'
)

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
https://challenges.cloudflare.com/cdn-cgi/challenge-platform
' can be anywhere in the URL, and arbitrary hosts may come before or after it.
@harlan-zw harlan-zw mentioned this pull request Apr 29, 2024
50 tasks
@nuxt-modules nuxt-modules deleted a comment from huang-julien May 6, 2024
@nuxt-modules nuxt-modules deleted a comment from huang-julien May 6, 2024

import { nextTick, useScriptCloudflareTurnstile, useRuntimeConfig, useNuxtApp, ref, onMounted, onBeforeUnmount } from '#imports'

const props = defineProps({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to expose a trigger option to allow users granular access of when the script loads, see https://github.com/nuxt/scripts/blob/main/src/runtime/components/ScriptGoogleMaps.vue#L44

Comment on lines 31 to +35
.map(url => url.toString())
.includes(
'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback',
),
// look for the challenge platform iframe
'https://challenges.cloudflare.com/cdn-cgi/challenge-platform'
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume converting these to URL objects would help?

url.map(url=>new URL(url.toString())).some(url=>url.hostname === 'challenges.cloudflare.com' && url.pathname === '/cdn-cgi/challenge-platform')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants