chrome->firefox
This commit is contained in:
parent
59f8e603f6
commit
ac1cb4a808
14
kpr-media.py
14
kpr-media.py
@ -1,18 +1,18 @@
|
|||||||
|
# This depends on `geckodriver`.
|
||||||
|
|
||||||
from flask import Flask, render_template_string, request, redirect, url_for
|
from flask import Flask, render_template_string, request, redirect, url_for
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.chrome.options import Options
|
from selenium.webdriver.firefox.options import Options
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
# Start browser in kiosk mode at server startup
|
# Start browser in kiosk mode at server startup
|
||||||
chrome_options = Options()
|
firefox_options = Options()
|
||||||
chrome_options.add_argument("--kiosk") # Fullscreen, good for TV
|
firefox_options.add_argument("--kiosk") # Kiosk mode, for fullscreen on some platforms
|
||||||
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
|
|
||||||
# chrome_options.add_experimental_option("detach", True) # Prevents Chrome from closing when script ends
|
|
||||||
|
|
||||||
# Store the browser globally
|
# Store the browser globally
|
||||||
browser = webdriver.Chrome(options=chrome_options)
|
browser = webdriver.Firefox(options=firefox_options)
|
||||||
browser.get("about:blank")
|
browser.get("about:blank")
|
||||||
|
|
||||||
@app.route("/", methods=["GET", "POST"])
|
@app.route("/", methods=["GET", "POST"])
|
||||||
@ -45,7 +45,7 @@ def index():
|
|||||||
<input type="text" name="url" placeholder="Pon la URL justo aqui" autofocus>
|
<input type="text" name="url" placeholder="Pon la URL justo aqui" autofocus>
|
||||||
<button type="submit">Send</button>
|
<button type="submit">Send</button>
|
||||||
</form>
|
</form>
|
||||||
<!-- <p style="opacity:0.5;font-size:smaller;">Tip: Only one tab is open at a time. The last submitted URL takes over the screen.</p> --!>
|
<!-- <p style="opacity:0.5;font-size:smaller;">Tip: Solo se muestra una pestana a la vez!.</p> --!>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
""")
|
""")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user