Stop XBMC opening menu when addon starts?
#1
I'm trying to make a very simple plugin that opens Firefox and points it to YouTube once the addon is run.
I'll start off by saying I only have a very basic understanding of what I'm doing here and so I need help with something that is happening.

When I open the addon it starts off by opening a menu, and then it opens Firefox.
I launch it from the home screen and if possible I would like for it to stay on the home screen and not try to open any menus.
Originally I added
Code:
xbmc.executebuiltin("ActivateWindow(home)")
but there is a delay so it still opens a menu before this happens and it's not very clean.

This is my full code:
Code:
import subprocess
import xbmcaddon

def index():
    xbmc.Player().stop()
    
    subprocess.Popen('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe http://www.youtube.com/leanback', shell=False)

index()

And here is a video showing what I mean by the menu opening:
https://www.dropbox.com/s/c2s1it46qq3xd51/kodi.mp4?dl=0
(What you can't see in that video if Firefox opening on top of the menu a little while after)


Any help would be much appreciated, thanks.
Reply
#2
It shouldnt switch menu. What´s your add-on extension point in addon.xml?
Also, take a loot at this, perhaps it´s useful for you: http://forum.kodi.tv/showthread.php?tid=230259
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Code:
<extension point="xbmc.python.pluginsource" library="default.py">
        <provides>executable</provides>
</extension>

I will give that a try, it looks interesting, thanks.

EDIT: I noticed that if I go to Program Add-ons and then run it, no extra menu opens up (I guess because one is already open?)
Reply
#4
you're not writing a plugin, so don't use the xbmc.python.pluginsource extention-point in your addon.xml

scripts, as that's what you've made, should use:
Code:
    <extension point="xbmc.python.script" library="default.py">
        <provides>executable</provides>
    </extension>

it's very important to understand the difference between scripts and plugins.
failing to do so will lead to unexpected behaviour when you run your addon.
http://kodi.wiki/view/Python_development...us_scripts
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Stop XBMC opening menu when addon starts?0