shinokada / svelte-utterances Goto Github PK
View Code? Open in Web Editor NEWHome Page: svelte-utterances.vercel.app
Home Page: svelte-utterances.vercel.app
After changing to another page, the theme goes back to the default theme. This can be fixed by using localStorage or Svelte/Stores?
Hey there, was looking through your package and noticed a few things that could be potentially improved:
$app/env
- The $app
alias is SvelteKit-specific and thus means that this component will not work properly on non-SvelteKit projects. This can be fixed by manually implementing your own browser check by reassigning a local browser
variable in an onMount
to be true
.utterances
id (as well as document.getElementById
) means that only once instance of the component can properly be mounted per page, since all IDs must be unique. Rather than using an ID, it might be more suitable to use the bind:this
directive on the div to obtain an instance-specific reference to the node.getElementsByTagName
usage - In the theme switcher code, the call to document.getElementsByTagName('iframe')[0]
will retrieve the first <iframe />
element throughout the entire page, meaning that the iFrame.contentWindow.postMessage
call will fail if the website has any iframe elements placed before the component in the document.The currently released NPM package is out of date, and you cannot set a theme with it.
theme="github-dark"
Could you please post a new release that has the latest code? Thanks!
The following code returns error:
...
const iFrame = document.getElementsByTagName("iframe")[0];
iFrame.contentWindow.postMessage(
...
err TypeError: Cannot read properties of undefined (reading 'contentWindow')
at Object.u.$$.update (doc.svelte-98be7cc1.js:1:1097)
at ve (vendor-60873d7e.js:1:7294)
at new be (doc.svelte-98be7cc1.js:1:1258)
at de (doc.svelte-98be7cc1.js:1:3349)
at ve (vendor-60873d7e.js:1:7340)
at new $e (doc.svelte-98be7cc1.js:1:5518)
at zt (index.md-070d2b67.js:18:3876)
at ve (vendor-60873d7e.js:1:7340)
at new Kt (index.md-070d2b67.js:18:4295)
at Array.Ve (start-7fe98c40.js:1:2515)
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://utteranc.es') does not match the recipient window's origin ('https://www.timsmith.tech').
Go to https://www.timsmith.tech/blog/converting-a-qwik-ai-app-to-sveltekit
At the bottom, try to login to comment
I am on the latest version of SvelteKit
Maybe the web app should exist in this package to add a demo of all features upon they are implemented.
This should make it easier to review new features, enhancement in each pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.