语言

Menu
Sites
Language
Loading a webpage from url

I have been trying to load a webpage from url using embed or iframe on a TV platform. On Tizen 5.0 Samsung-tv emulator it opens web browser, on Tizen 3.0 Samsung Emulator and Actual TV, first launch opens browser but app launch from apps just opens blank background. App seem to work as expected on Simulator without any issue.

config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/NewsFeed" version="1.0.0" viewmodes="maximized">
    <access origin="*" subdomains="true"></access>
    <tizen:application id="lcz2LWGAiI.WebView" package="lcz2LWGAiI" required_version="2.4"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>NewsFeed</name>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:profile name="tv-samsung"/>
    
</widget>

index.html:

<!DOCTYPE html>
<html>
    <head>    
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">   
        <meta charset="UTF-8" />        
        <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
        <div class='embed-container'>
        	<iframe src="http://example.com" frameborder='0' allowfullscreen>
        </div>
    </body>
</html>

style.css:

body {
    background: #ffffff;
	font-size: 15px;
	color: #aa3e03;
}

.embed-container {
   position: static;
   height: 0;
   overflow: hidden;
   max-width: 100%;
}
.embed-container embed {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
}

Is there any way to prevent this from happening?

 

EDIT:

Fixed it by adding allow-navigation in config file:

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/NewsFeed" version="1.0.0" viewmodes="maximized">
    <access origin="*" subdomains="true"></access>
    <tizen:allow-navigation>example.com</tizen:allow-navigation>
    <tizen:application id="lcz2LWGAiI.WebView" package="lcz2LWGAiI" required_version="2.4"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>NewsFeed</name>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:profile name="tv-samsung"/>
</widget>

 

编辑者为: Bhatt 09 1月, 2019