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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show HTML previews for inscriptions (e.g. recursive) #4077

Closed
markmhendrickson opened this issue Jul 31, 2023 · 8 comments · Fixed by #4695
Closed

Show HTML previews for inscriptions (e.g. recursive) #4077

markmhendrickson opened this issue Jul 31, 2023 · 8 comments · Fixed by #4695
Assignees
Labels
area:collectibles Issues related to non-fungible tokens (NFTs) area:ordinals enhancement-p2 Critical functionality needed by few users, with no clear alternatives

Comments

@markmhendrickson
Copy link
Collaborator

markmhendrickson commented Jul 31, 2023

https://ordinals.hiro.so/sat/390660864168

https://docs.ordinals.com/inscriptions.html#sandboxing

@markmhendrickson markmhendrickson converted this from a draft issue Jul 31, 2023
@markmhendrickson markmhendrickson added Enhancement 💡 enhancement-p2 Critical functionality needed by few users, with no clear alternatives area:collectibles Issues related to non-fungible tokens (NFTs) area:ordinals labels Jul 31, 2023
@markmhendrickson markmhendrickson self-assigned this Jul 31, 2023
@markmhendrickson markmhendrickson moved this from Triage to Assigned in Hiro Wallet (DEPRECATED) Jul 31, 2023
@314159265359879
Copy link
Contributor

If we want to use this solution to show this inscription
https://ordinals.hiro.so/inscription/14effa0e0a947cc05cab869d50626cdaf2ad1cbc05f81dbc8d99cb763116f117i0

As it is displayed on ord.io:
image

https://www.ord.io/bc1pd4fjc9cyg8wfgc3x7d3pcxc99tmn6vqw5gstp6hhmputm06rw2tqdqdtxd

Are there any changes needed from the ordinals-api too? Or rather the explorer so it is displayed there similarly too? @rafaelcr

@markmhendrickson
Copy link
Collaborator Author

@kyranjamie thoughts here on whether we can embed HTML previews safely in the wallet somehow, or whether we need to request a preview image (perhaps animated) from the API that can be used instead?

@markmhendrickson markmhendrickson removed their assignment Aug 15, 2023
@markmhendrickson markmhendrickson moved this from Assigned to Triage in Hiro Wallet (DEPRECATED) Aug 15, 2023
@kyranjamie
Copy link
Collaborator

I would be reluctant to add iframes tbh, even if we can have a very strict CSP to lock things down. Is this feature in demand?

Embeddable content just seems like it'd create such as cess pit of scammers.

@314159265359879
Copy link
Contributor

@kyranjamie I agree we do not want to create such a hole in the wallet for scammers to take advantage of. We should still show some placeholder in the wallet, perhaps even a warning/explanation about the type of ordinal?

@markmhendrickson markmhendrickson linked a pull request Sep 26, 2023 that will close this issue
@314159265359879
Copy link
Contributor

I see this PR for embedding iframes which can resolve this #4077

This recursive inscription doesn't load in that build (4269). Perhaps it is using something else. It should be displaying several .svg files on top of each other. Should this be covered by this PR or would that require a different kind of enhancement?

Example inscription: https://ordinals.hiro.so/inscription/6795bcea8de910906a20643a300484005b3df113a9246a43b7408efb8a0036a7i0
text/code of the inscription:
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1025 1025" height="100%" width="100%" id="bitcoin-face-for-werner.btc"> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/8723751cfc76f030dcd8c7be883fc0ab95eec8a4274f55caf00d20f151fbfe64i0" id="background-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/0991d1034aa2f40b13b82774f9b6faccee23b037ad352b5edcca27e8cb05bde9i0" id="body-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/c029f0afeea66091a573fba60dbe3e5e7301828dc520610a9eae120364a6b5d0i0" id="head-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/49f8014d388de06928f604d2ac6eb7380d2fcfa441570ce96004e62da21945b5i0" id="ears-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/6ec67f9a3061fc866c3cbcd9c1a30b2ae1c9e3c20f486bd689d3e3886bbf725di0" id="chain-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/7b16e48fbc6658a6646b660d50af0f955abaa37bb1b8f0532ba53158bf71a6dbi0" id="mouth-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/b439feeb2356b77bdc63617dc8a3437b0cbbe4d261b8f2041eb4d81bfec92da7i0" id="nose-1"></image> <image height="100%" width="100%" y="0" x="0" xlink:href="/content/629079513bdae4bc955fbb309fdbc8092ed4761f43e2c46144cc8cb04644921bi0" id="eyes-1"></image> </svg>

@314159265359879
Copy link
Contributor

314159265359879 commented Oct 23, 2023

Another example of recursive inscriptions that do no currently show in the wallet, they will appear blank or black.

image

Here are two more examples of an ordinal that doesn't show yet on the Hiro explorer and the code it uses:
https://ordinals.hiro.so/inscription/604fec792efe3526a8989d61c44ed52f30bdf5a807a34c86428edf1700055bcei0
https://ordinals.hiro.so/inscription/30a2fdd98d363d182f75ce96ddc6b3ffe1eeb29d2a05e748a208a49b033557a2i0

image

This is the original inscription being expected to be displayed recursively via the code in #32321985 (and #...88): https://ordinals.hiro.so/inscription/604fec792efe3526a8989d61c44ed52f30bdf5a807a34c86428edf1700055bcei0


This is an example of an ordinal showing up black in the wallet, although displaying correctly on explorer.hiro.so:
https://ordinals.hiro.so/inscription/efba55d53fb0f11d091ee0eca2f8d5a0fab4d4fdde35733d03c40f9c5c429dd0i0

image

This is what is displayed in ordiscan.com (see code and submodules, avif and js)
image

Is it safe to show this in the wallet? if not can we display a message about that in the wallet instead to help users understand why it is blank/black instead of displaying their inscription image?

@314159265359879
Copy link
Contributor

The owner of this inscription would like this displayed as an image if possible. It is a cursed recursive inscription:

Note the difference in short inscription number, reported here: hirosystems/ordhook#202

https://ordinals.hiro.so/inscription/81433a25e784366a7db917af98393be6eba232a03646e1fc072904fc3b8803b2i2
image

https://www.ord.io/81433a25e784366a7db917af98393be6eba232a03646e1fc072904fc3b8803b2i2
image

@markmhendrickson
Copy link
Collaborator Author

markmhendrickson commented Nov 2, 2023

We discussed this earlier this week with @kyranjamie and @janniks and concluded that it seems safe to attempt an iframing approach for HTML inscriptions, one in which iframes are loaded only when in view / within the viewport, to avoid possible performance issues to loading many on a given screen as the user scrolls.

@fbwoolf fbwoolf removed a link to a pull request Dec 13, 2023
@fbwoolf fbwoolf linked a pull request Dec 13, 2023 that will close this issue
kyranjamie pushed a commit that referenced this issue Dec 19, 2023
## [6.21.0](v6.20.0...v6.21.0) (2023-12-19)

### Features

* html video and audio inscription types, closes [#4077](#4077) and [#3556](#3556) ([e19eea4](e19eea4))
* modified contracts and balance fetching ([63d29ba](63d29ba))
* updated dlc tools version ([8dc1d22](8dc1d22))

### Bug Fixes

* collectibles refetch, closes [#4413](#4413) ([13aa68f](13aa68f))
* deprecate legacy font sizes, closes [#4587](#4587) ([5f539ca](5f539ca))
* handle inscription type svg, ref [#4727](#4727) ([b713c70](b713c70))
* only show swaps option on mainnet, closes [#4687](#4687) ([af6443c](af6443c))
* swaps test, ref [#4725](#4725) ([faae457](faae457))
* **wallet:** fees warning alignment fix ([d771bcc](d771bcc))

### Internal

* post-release merge back ([75f4998](75f4998))
pete-watters pushed a commit to Nithishvb/extension that referenced this issue Jan 17, 2024
pete-watters pushed a commit to Nithishvb/extension that referenced this issue Jan 17, 2024
## [6.21.0](leather-io/extension@v6.20.0...v6.21.0) (2023-12-19)

### Features

* html video and audio inscription types, closes [leather-io#4077](leather-io#4077) and [leather-io#3556](leather-io#3556) ([e19eea4](leather-io@e19eea4))
* modified contracts and balance fetching ([63d29ba](leather-io@63d29ba))
* updated dlc tools version ([8dc1d22](leather-io@8dc1d22))

### Bug Fixes

* collectibles refetch, closes [leather-io#4413](leather-io#4413) ([13aa68f](leather-io@13aa68f))
* deprecate legacy font sizes, closes [leather-io#4587](leather-io#4587) ([5f539ca](leather-io@5f539ca))
* handle inscription type svg, ref [leather-io#4727](leather-io#4727) ([b713c70](leather-io@b713c70))
* only show swaps option on mainnet, closes [leather-io#4687](leather-io#4687) ([af6443c](leather-io@af6443c))
* swaps test, ref [leather-io#4725](leather-io#4725) ([faae457](leather-io@faae457))
* **wallet:** fees warning alignment fix ([d771bcc](leather-io@d771bcc))

### Internal

* post-release merge back ([75f4998](leather-io@75f4998))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:collectibles Issues related to non-fungible tokens (NFTs) area:ordinals enhancement-p2 Critical functionality needed by few users, with no clear alternatives
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants