Embed Tweets in an iframe - https://tf.rita.moe

Use URLSearchParams

Changed files
+4 -4
+4 -4
show.html
···
</blockquote>
<script>
const params = {}
-
window.location.search.slice(1).split('&').forEach((part) => {
-
const item = part.split('=')
-
params[item[0]] = decodeURIComponent(item[1]).replace(/\+/g, ' ')
-
})
+
const searchParams = new URLSearchParams(window.location.search)
+
for (const [key, value] of searchParams.entries()) {
+
params[key] = value.replace(/\+/g, ' ')
+
}
const url = params['url'] || ''
const datetime = (params['datetime'] || 0)