First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.
What I’m trying to do
Hi, I’m trying to learn and get a grip on Obsidian Web Clipper. My focus now is on getting Obsidian Web Clipper on iOS (with Safari), and have the Clipper use a (or the correct) template.
I’m using Kepano’s very helpful and great templates as source link.
As I’m working on iPhone as you’ll understand, editing is not always easy..
I could not immediately find an evident way to copy / paste the json of the template
so I created a new template and manually typed in the contents (fairly typo prone, but the template helps with some error highlighting)
What are the results:
The web clipper works and uses the youtube template that I created
but a couple of properties are not filling in: author and image
I then tried to copy paste the json, named the template youtube-2, but that did not work
So I guess here, the near identical naming gets in the way?
then had a lot of trouble in deleting a template => pressing the trash icon simply does not react
I then found out by trial and error, opening closing Safari to reload that I finally had deleted the twin youtube-2 template
So the way I am able to use the web clipper on youtube pages in Safari, is to press the extension icon in the addressbar, then wait a little to have the clipper populate the properties, then I press “Add to Obsidian”
In fact everything works, apart from the author property not being filled.
Does anybody have any pointer as to how to get this working?
Thanks for replying;
I’m using kepano’s youtube-clipper template on macOS in a browser, and there it works without any issues.
But when using it on my iPhone, I get the issues described in my initial post.
That’s how I can compare both results (after obsidian sync)
To be more specific:
I’m referring to Kepano’s Templates, specifically the Youtube template.
Ah okay. Sorry I didnt get that the script is working on MacOS.
However, a mobile version of the website might not resemble the desktop version. I tested it quickly on iOS and you can see in the image that the author field is empty. For the same video on desktop it correctly showed the YouTube channel.
So you can check if the same applies for you and then you need to adjust the template for mobile to reference a different variable than author.
Yes, the same applies for me, that was the reason for this post from the beginning, unfortunately I could not edit / correct my initial post.
If I understand you correctly, there are differences in the variables between desktop browser (macOS-chrome based) and mobile browser (iOS-safari)?
This appears odd to me, but it may be possible.
Do you have any idea where I could find these (mobile version) variables?
Can we somehow check them?
Also, what ways are there to sync these browser extension templates between desktop browser and mobile browser?
As fas as I have been able to check:
in iOS > Settings > apps > Safari > Extensions > Obsidian Web Clipper > Settings ===>>> throws you into a Safari page with focus on Obsidian Web Clipper
Not exactly. The variables are provided by web clipper to make it easier to access data of the website. If the HTML code of the website is different, the variables sometimes cannot catch the correct HTML element.
Different mobile and desktop websites are actually quite common, especially for larger websites.
If you know how HTML works, you can target every HTML element you need.
I recommend you just have a look in the GitHub repo of Web Clipper and check if the issue is known, if not you can open an issue. Then it might be fixed, so author will work correctly.
You can also always just request the desktop version of a website on mobile. Then you web clipper script will work.
Ok, thanks for pointing that out.
I’m also having a look at Schema.org (don’t immediately see where I picked this one up, but I think it was somewhere either on the Obsidian Web Clipper help page or the example templates (which are from Kepano).
To be honest, I’m not afraid from the terminal and neither of some code, but I am definitely not a “coder” or specialist, so I tend to be overly careful here.
From schema.org, I can imagine that the JSON-LD for author (I just searched for it, no more) somehow relates to the input that the Obsidian Web Clipper template needs. (link to JSON-LD)
Is that correct?
I’m also aware of w3schools.com.
Is there some way of testing the web clipper code there?
For the time being, I’ve indeed requested the desktop site (youtube) and indeed the clipper then works. But of course it would be an interesting exercise to try and find how to solve the non-desktop clipper missing metadata values.
I tested some more websites and it seems (I dont know why) that on mobile sometimes the author field is not filled, but it will be filled when you simply reload the website. This also worked on YouTube.