blob: 27ee59e3a955f0cab30fa969957f7a864796fce5 [file] [log] [blame]
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<meta charset="utf-8">
<if expr="is_android">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</if>
<title>Snippets Internals</title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="snippets_internals.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/jstemplate_compiled.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="snippets_internals.js"></script>
<script src="strings.js"></script>
<div id="info">
<div>
<h2>Properties</h2>
<table class="section-details">
<tr>
<td class="name">Article Suggestions enabled
<td id="flag-article-suggestions" class="value">
<tr>
<td class="name">Recent Tab Suggestions enabled
<td id="flag-recent-offline-tab-suggestions" class="value">
<tr>
<td class="name">Offlining Recent Tabs enabled
<td id="flag-offlining-recent-pages-feature" class="value">
<tr>
<td class="name">Asset Download Suggestions enabled
<td id="flag-asset-download-suggestions" class="value">
<tr>
<td class="name">Offline Page Download Suggestions enabled
<td id="flag-offline-page-download-suggestions" class="value">
<tr>
<td class="name">Bookmark Suggestions enabled
<td id="flag-bookmark-suggestions" class="value">
<tr>
<td class="name">Physical Web Page Suggestions enabled
<td id="flag-physical-web-page-suggestions" class="value">
<tr>
<td class="name">Physical Web enabled
<td id="flag-physical-web" class="value">
<tr>
<td class="name">Snippets type
<td id="switch-personalized" class="value">
<tr>
<td class="name">Snippets fetch URL
<td id="switch-fetch-url" class="value">
<tr>
<td class="name">Server-provided experiment IDs
<td id="experiment-ids" class="value">
</table>
</div>
<div>
<h2>UserClassifier</h2>
<table class="section-details">
<tr>
<td class="name">User class
<td id="user-class" class="value">
<tr>
<td class="name">Estimated average time to open NTP
<td id="avg-time-to-open-ntp" class="value">
<tr>
<td class="name">Estimated average time to show suggestions
<td id="avg-time-to-show" class="value">
<tr>
<td class="name">Estimated average time to use suggestions
<td id="avg-time-to-use" class="value">
</table>
<button id="clear-classification" type="button">
Clear my classification
</button>
</div>
<div id="ranker">
<h2>CategoryRanker</h2>
<table class="section-details">
<tr jsselect="list" style="display:none">
<td jscontent="label">
<td jscontent="content" class="value">
</tr>
</table>
</div>
<div id="snippets">
<h2>NTPSnippetsService</h2>
<div class="forms">
<div>
<button id="submit-download" type="button">Add snippets</button>
<span id="remote-status" class="detail"></span>
</div>
<div>
<button id="debug-log-dump" type="button">Dump the debug log</button>
</div>
<div>
<button type="button" class="submit-clear-cached-suggestions">
Clear cached suggestions
</button>
</div>
</div>
</div>
<div id="last-json" class="hidden">
<h2>Last JSON from Server</h2>
<a id="last-json-button">Show the last JSON &gt;&gt;</a>
<div id="last-json-container" class="hidden">
<div id="last-json-text"></div>
<button id="last-json-dump" type="button">Dump the last JSON</button>
</div>
</div>
<div id="remote-content-suggestions">
<h2>Remote content suggestions</h2>
<div>
<span>Last Background Fetch Time: </span>
<span id="last-background-fetch-time-label"></span>
</div>
<button id="background-fetch-button" type="button">
Fetch remote suggestions in the background in 2 seconds
</button>
<button id="push-dummy-suggestion-10-seconds-button" type="button">
Push dummy suggestion in 10 seconds
</button>
</div>
<div id="notifications">
<h2>Notifications</h2>
<div>
<button id="reset-notifications-state-button" type="button">
Reset notifications state
</button>
</div>
<div id="content-suggestions">
<h2>Content suggestions by category
<span class="detail">(click for details)</span>
<button id="submit-dump" type="button">Dump the list</button>
</h2>
<div jsselect="list" style="display:none">
<div>
<h3 style="margin-bottom: 0px; padding-bottom: 0px;">
<span jscontent="title"></span>
<span class="detail">
(id = <span jscontent="categoryId"></span>,
<span jscontent="status"></span>)
</span>
</h3>
</div>
<div class="vertical-buttons">
<button jsvalues="category-id:categoryId" type="button"
class="toggle-dismissed-suggestions">
Show dismissed suggestions
</button>
<button jsvalues="category-id:categoryId" type="button"
class="submit-clear-dismissed-suggestions">
Clear dismissed suggestions
</button>
</div>
<table class="section-details">
<tr jsselect="suggestions" style="display:none">
<td class="title-link">
<span class="hidden-toggler content-suggestion-title"
jsvalues="hidden-id:id">
<span jscontent="title"></span>&gt;&gt;
</span>
<div jsvalues="id:id" class="content-suggestion-detail hidden">
<table>
<tr>
<td>ID
<td jscontent="idWithinCategory">
<tr>
<td>URL
<td><a class="url" jsvalues="href:url" jscontent="url"></a>
<tr>
<td>URL with favicon
<td>
<a class="url" jsvalues="href:urlWithFavicon"
jscontent="urlWithFavicon"></a>
<tr>
<td>Snippet text
<td jscontent="snippetText">
<tr>
<td>Publish date
<td class="expiry">
<span class="date" jscontent="publishDate"></span>
<tr>
<td>Publisher name
<td jscontent="publisherName">
<tr>
<td>Score
<td jscontent="score">
</table>
</div>
</table>
<table jsvalues="id:dismissedContainerId"
class="section-details hidden">
<thead>
<tr>
<th style="text-align:left">Dismissed suggestions
</thead>
<tr jsselect="dismissedSuggestions" style="display:none">
<td class="title-link">
<span class="hidden-toggler content-suggestion-title"
jsvalues="hidden-id:id">
<span jscontent="title"></span> (dismissed)&gt;&gt;
</span>
<div jsvalues="id:id" class="content-suggestion-detail hidden">
<table>
<tr>
<td>ID
<td jscontent="suggestionId">
<tr>
<td>URL
<td><a class="url" jsvalues="href:url" jscontent="url"></a>
<tr>
<td>Snippet text
<td jscontent="snippetText">
<tr>
<td>Publish date
<td class="expiry">
<span class="date" jscontent="publishDate"></span>
<tr>
<td>Publisher name
<td jscontent="publisherName">
<tr>
<td>Score
<td jscontent="score">
</table>
</div>
</table>
</div>
<div class="detail" id="content-suggestions-empty"></div>
</div>
<div id="contextual-suggestions-section" class="hidden">
<h2>Contextual Suggestions</h2>
<h3>Request for URL</h3>
<input type="url" id="contextual-url"
value="https://en.wikipedia.org/wiki/Persian_language"></input>
<button id="fetch-contextual-suggestions-button">
Fetch Contextual Suggestions
</button>
<h3>Response status</h3>
<div id="contextual-suggestions-request-result">
No request sent yet.
</div>
<h3>Contextual Suggestions response</h3>
<div id="contextual-suggestions">
<table class="section-details">
<tr jsselect="list" style="display:none">
<td class="title-link">
<span class="contextual-hidden-toggler content-suggestion-title"
jsvalues="hidden-id:id">
<span jscontent="title"></span>&gt;&gt;
</span>
<div jsvalues="id:id" class="content-suggestion-detail hidden">
<table>
<tr>
<td>ID
<td jscontent="idWithinCategory">
<tr>
<td>URL
<td><a class="url" jsvalues="href:url" jscontent="url"></a>
<tr>
<td>URL with favicon
<td>
<a class="url" jsvalues="href:urlWithFavicon"
jscontent="urlWithFavicon"></a>
<tr>
<td>Publisher name
<td jscontent="publisherName">
</table>
</div>
</table>
</div>
</div>
</div>