Jump to content

How to embed a link or script on homepage


Cheeseburger

Recommended Posts

Cheeseburger

Hi!

 

Basic question: How to insert javascript in Emby homepage and let it become visible OR just insert a URL link to other server?

 

What

I'd like to embed a script if possible otherwise a link that starts the Rocket.Chat Livechat feature for all users when they have logged in to Emby webapp. It would be a simple solution requiring a minimum of effort and knowledge from my users to be able to drop me a line when needed (interactive and offline).

 

I have a working Rocket.Chat server with Livechat enabled and Emby server running the latest stable, both hosted on their own sub domain behind the same NGINX-reverse proxy with a wildcard cert.

 

Embedded route...

Below is what according to the instructions is supposed to be inserted before </body> of the page.

<script type="text/javascript">
(function(w, d, s, u) {
	w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
	var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
	j.async = true; j.src = 'https://sub2.domain.dn/livechat/1.0.0/rocketchat-livechat.min.js?_=201903270000';
	h.parentNode.insertBefore(j, h);
})(window, document, 'script', 'https://sub2.domain.dn/livechat?version=1.0.0');
</script>

Tried it in index.html, inspection from the browser shows no errors and can show a box marker in the windows where it should be but you can't see it nor interact with it.

 

I guess some CSS (which I don't really know) should be added to the Custom CSS-field in the dash to allow it visibility in the right layer?  Need to be visible either on just a page (home, or maybe usermenu) alternatively most places as long as it doesn't interfere with the playback of video. (It wants to pop up small in the right bottom corner and can then be expanded or opened in separate window.)

 

 

...Or linking to it

If the above is not possible or good for any reason, inserting a link somewhere could do. Have tried a few things but do not know CSS and modern web design nor how all this goes together in Emby.

 

Some potential places:

  • Right side of the text links Home and Favorites on the homepage
  • Another button left of the user settings and dashboard buttons in the top right corner
  • Item in the main drawer
  • Item in user menu

 

Sorry for a long post about something potentially trivial  :) Any help greatly appreciated!

 

 

(I know that changes to Emby HTML will be overwritten when updating the server.)

 

(Maybe someone could make a super simple "channel" plugin to create a "library" where the items are just admin controlled links to external resources?)

Edited by Cheeseburger
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...