From 804aafb265e93c50abcb4d2c28e0ddfab16a36bb Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Tue, 31 May 2022 16:07:41 +0100 Subject: Fix open image in app or externally (instead of popup) (#37) Fix #195 on Ferdium-app which causes a problem when opening images inside the discord (and possibly zoom). --- docs/frontend_api.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'docs/frontend_api.md') diff --git a/docs/frontend_api.md b/docs/frontend_api.md index af9acf8..f1edc0f 100644 --- a/docs/frontend_api.md +++ b/docs/frontend_api.md @@ -29,9 +29,12 @@ - [safeParseInt(stringText)](#safeparseintstringtext) - [Arguments](#arguments-8) - [Usage](#usage-8) - - [setDialogTitle(title)](#setdialogtitletitle-1) + - [isImage(url)](#isimageurl) - [Arguments](#arguments-9) - [Usage](#usage-9) + - [setDialogTitle(title)](#setdialogtitletitle-1) + - [Arguments](#arguments-10) + - [Usage](#usage-10) # Frontend API @@ -305,6 +308,20 @@ A utility method that can be used to safely parse the text content (handles null Ferdium.safeParseInt(mySelector.innerText) ``` +### isImage(url) + +A utility method that can be used to verify if a url is an image. Returns `true` if is image and `false` if it is not an image. + +#### Arguments + +1. `url` Url to be parsed. + +#### Usage + +```JavaScript +Ferdium.isImage(url) +``` + ### setDialogTitle(title) When you want to set the title of the Ferdium window (while this service is active or in focus), you can use this function -- cgit v1.2.3-54-g00ecf