mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 04:27:37 +00:00
Merge fx-team to m-c. a=merge
This commit is contained in:
commit
1eb75d51c5
@ -1409,8 +1409,8 @@ pref("devtools.inspector.activeSidebar", "ruleview");
|
||||
// Enable the markup preview
|
||||
pref("devtools.inspector.markupPreview", false);
|
||||
pref("devtools.inspector.remote", false);
|
||||
// Expand pseudo-elements by default in the rule-view
|
||||
pref("devtools.inspector.show_pseudo_elements", true);
|
||||
// Collapse pseudo-elements by default in the rule-view
|
||||
pref("devtools.inspector.show_pseudo_elements", false);
|
||||
// The default size for image preview tooltips in the rule-view/computed-view/markup-view
|
||||
pref("devtools.inspector.imagePreviewTooltipSize", 300);
|
||||
// Enable user agent style inspection in rule-view
|
||||
@ -1836,6 +1836,9 @@ pref("identity.fxaccounts.remote.profile.uri", "https://profile.accounts.firefox
|
||||
// The remote URL of the FxA OAuth Server
|
||||
pref("identity.fxaccounts.remote.oauth.uri", "https://oauth.accounts.firefox.com/v1");
|
||||
|
||||
// Whether we display profile images in the UI or not.
|
||||
pref("identity.fxaccounts.profile_image.enabled", true);
|
||||
|
||||
// Migrate any existing Firefox Account data from the default profile to the
|
||||
// Developer Edition profile.
|
||||
#ifdef MOZ_DEV_EDITION
|
||||
|
@ -90,6 +90,12 @@ var FullScreen = {
|
||||
// This is needed if they use the context menu to quit fullscreen
|
||||
this._isPopupOpen = false;
|
||||
this.cleanup();
|
||||
// In TabsInTitlebar._update(), we cancel the appearance update on
|
||||
// resize event for exiting fullscreen, since that happens before we
|
||||
// change the UI here in the "fullscreen" event. Hence we need to
|
||||
// call it here to ensure the appearance is properly updated. See
|
||||
// TabsInTitlebar._update() and bug 1173768.
|
||||
TabsInTitlebar.updateAppearance(true);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -5066,7 +5066,15 @@ var TabsInTitlebar = {
|
||||
if (this._lastSizeMode == sizemode) {
|
||||
return;
|
||||
}
|
||||
let oldSizeMode = this._lastSizeMode;
|
||||
this._lastSizeMode = sizemode;
|
||||
// Don't update right now if we are leaving fullscreen, since the UI is
|
||||
// still changing in the consequent "fullscreen" event. Code there will
|
||||
// call this function again when everything is ready.
|
||||
// See browser-fullScreen.js: FullScreen.toggle and bug 1173768.
|
||||
if (oldSizeMode == "fullscreen") {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (let something in this._disallowed) {
|
||||
|
@ -501,6 +501,16 @@ input[type=button] {
|
||||
transform: translate(-30px, -20px) scale(0) translate(30px, 20px);
|
||||
}
|
||||
|
||||
#newtab-customize-panel:-moz-locale-dir(rtl) {
|
||||
transform-origin: 40px top 20px;
|
||||
}
|
||||
|
||||
#newtab-customize-panel:-moz-locale-dir(rtl),
|
||||
#newtab-customize-panel-anchor:-moz-locale-dir(rtl) {
|
||||
left: 15px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
#newtab-customize-panel[open="true"] {
|
||||
transform: translate(-30px, -20px) scale(1) translate(30px, 20px);
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ skip-if = buildapp == 'mulet'
|
||||
[browser_parsable_css.js]
|
||||
skip-if = e10s
|
||||
[browser_parsable_script.js]
|
||||
skip-if = asan # Disabled because it takes a long time (see test for more information)
|
||||
skip-if = asan || (os == 'linux' && !debug && (bits == 32)) # disabled on asan because of timeouts, and bug 1172468 for the linux 32-bit pgo issue.
|
||||
|
||||
[browser_pinnedTabs.js]
|
||||
[browser_plainTextLinks.js]
|
||||
|
@ -8,7 +8,7 @@ let suggestedLink = {
|
||||
imageURI: "data:image/png;base64,helloWORLD3",
|
||||
title: "title2",
|
||||
type: "affiliate",
|
||||
frecent_sites: ["classroom.google.com", "codecademy.com", "elearning.ut.ac.id", "khanacademy.org", "learn.jquery.com", "teamtreehouse.com", "tutorialspoint.com", "udacity.com", "w3cschool.cc", "w3schools.com"]
|
||||
frecent_sites: ["classroom.google.com", "codeacademy.org", "codecademy.com", "codeschool.com", "codeyear.com", "elearning.ut.ac.id", "how-to-build-websites.com", "htmlcodetutorial.com", "htmldog.com", "htmlplayground.com", "learn.jquery.com", "quackit.com", "roseindia.net", "teamtreehouse.com", "tizag.com", "tutorialspoint.com", "udacity.com", "w3schools.com", "webdevelopersnotes.com"]
|
||||
};
|
||||
|
||||
gDirectorySource = "data:application/json," + JSON.stringify({
|
||||
@ -139,7 +139,7 @@ function runTests() {
|
||||
is(type, "affiliate", "suggested link is affiliate");
|
||||
is(enhanced, "", "suggested link has no enhanced image");
|
||||
is(title, "title2");
|
||||
ok(suggested.indexOf("Suggested for <strong> Web Education </strong> visitors") > -1, "Suggested for 'Web Education'");
|
||||
ok(suggested.indexOf("Suggested for <strong> webdev education </strong> visitors") > -1, "Suggested for 'webdev education'");
|
||||
|
||||
// Enhanced history link shows up second
|
||||
({type, enhanced, title, suggested} = getData(1));
|
||||
@ -176,7 +176,7 @@ function runTests() {
|
||||
ok(suggested.indexOf("Suggested for <strong> Technology </strong> enthusiasts who visit sites like <strong> classroom.google.com </strong>") > -1, "Suggested for 'Technology' enthusiasts");
|
||||
|
||||
|
||||
// Test server provided explanation string without category override.
|
||||
// Test server provided explanation string without category override.
|
||||
delete suggestedLink.adgroup_name;
|
||||
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE,
|
||||
"data:application/json," + encodeURIComponent(JSON.stringify({"suggested": [suggestedLink]})));
|
||||
@ -185,5 +185,31 @@ function runTests() {
|
||||
yield addNewTabPageTab();
|
||||
({type, enhanced, title, suggested} = getData(0));
|
||||
Cu.reportError("SUGGEST " + suggested);
|
||||
ok(suggested.indexOf("Suggested for <strong> Web Education </strong> enthusiasts who visit sites like <strong> classroom.google.com </strong>") > -1, "Suggested for 'Web Education' enthusiasts");
|
||||
ok(suggested.indexOf("Suggested for <strong> webdev education </strong> enthusiasts who visit sites like <strong> classroom.google.com </strong>") > -1, "Suggested for 'webdev education' enthusiasts");
|
||||
|
||||
|
||||
|
||||
// Test with xml entities in category name
|
||||
suggestedLink.url = "http://example1.com/3";
|
||||
suggestedLink.adgroup_name = ">angles< & \"quotes\'";
|
||||
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE,
|
||||
"data:application/json," + encodeURIComponent(JSON.stringify({"suggested": [suggestedLink]})));
|
||||
yield watchLinksChangeOnce().then(TestRunner.next);
|
||||
|
||||
yield addNewTabPageTab();
|
||||
({type, enhanced, title, suggested} = getData(0));
|
||||
Cu.reportError("SUGGEST " + suggested);
|
||||
ok(suggested.indexOf("Suggested for <strong> >angles< & \"quotes\' </strong> enthusiasts who visit sites like <strong> classroom.google.com </strong>") > -1, "Suggested for 'xml entities' enthusiasts");
|
||||
|
||||
|
||||
// Test with xml entities in explanation.
|
||||
suggestedLink.explanation = "Testing junk explanation &<>\"'";
|
||||
Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE,
|
||||
"data:application/json," + encodeURIComponent(JSON.stringify({"suggested": [suggestedLink]})));
|
||||
yield watchLinksChangeOnce().then(TestRunner.next);
|
||||
|
||||
yield addNewTabPageTab();
|
||||
({type, enhanced, title, suggested} = getData(0));
|
||||
Cu.reportError("SUGGEST " + suggested);
|
||||
ok(suggested.indexOf("Testing junk explanation &<>\"'") > -1, "Junk test");
|
||||
}
|
||||
|
@ -730,6 +730,7 @@ loop.panel = (function(_, mozL10n) {
|
||||
var description = metadata.title || metadata.description;
|
||||
var url = metadata.url;
|
||||
this.setState({
|
||||
checked: false,
|
||||
previewImage: previewImage,
|
||||
description: description,
|
||||
url: url
|
||||
@ -775,7 +776,8 @@ loop.panel = (function(_, mozL10n) {
|
||||
return (
|
||||
React.createElement("div", {className: "new-room-view"},
|
||||
React.createElement("div", {className: contextClasses},
|
||||
React.createElement(Checkbox, {label: mozL10n.get("context_inroom_label"),
|
||||
React.createElement(Checkbox, {checked: this.state.checked,
|
||||
label: mozL10n.get("context_inroom_label"),
|
||||
onChange: this.onCheckboxChange}),
|
||||
React.createElement(sharedViews.ContextUrlView, {
|
||||
allowClick: false,
|
||||
|
@ -730,6 +730,7 @@ loop.panel = (function(_, mozL10n) {
|
||||
var description = metadata.title || metadata.description;
|
||||
var url = metadata.url;
|
||||
this.setState({
|
||||
checked: false,
|
||||
previewImage: previewImage,
|
||||
description: description,
|
||||
url: url
|
||||
@ -775,7 +776,8 @@ loop.panel = (function(_, mozL10n) {
|
||||
return (
|
||||
<div className="new-room-view">
|
||||
<div className={contextClasses}>
|
||||
<Checkbox label={mozL10n.get("context_inroom_label")}
|
||||
<Checkbox checked={this.state.checked}
|
||||
label={mozL10n.get("context_inroom_label")}
|
||||
onChange={this.onCheckboxChange} />
|
||||
<sharedViews.ContextUrlView
|
||||
allowClick={false}
|
||||
|
@ -664,14 +664,21 @@ loop.roomViews = (function(mozL10n) {
|
||||
|
||||
return true;
|
||||
|
||||
case ROOM_STATES.READY:
|
||||
case ROOM_STATES.INIT:
|
||||
case ROOM_STATES.JOINING:
|
||||
case ROOM_STATES.SESSION_CONNECTED:
|
||||
case ROOM_STATES.JOINED:
|
||||
case ROOM_STATES.MEDIA_WAIT:
|
||||
// this case is so that we don't show an avatar while waiting for
|
||||
// the other party to connect
|
||||
return true;
|
||||
|
||||
case ROOM_STATES.CLOSING:
|
||||
return true;
|
||||
|
||||
default:
|
||||
console.warn("StandaloneRoomView.shouldRenderRemoteVideo:" +
|
||||
console.warn("DesktopRoomConversationView.shouldRenderRemoteVideo:" +
|
||||
" unexpected roomState: ", this.state.roomState);
|
||||
return true;
|
||||
}
|
||||
|
@ -664,14 +664,21 @@ loop.roomViews = (function(mozL10n) {
|
||||
|
||||
return true;
|
||||
|
||||
case ROOM_STATES.READY:
|
||||
case ROOM_STATES.INIT:
|
||||
case ROOM_STATES.JOINING:
|
||||
case ROOM_STATES.SESSION_CONNECTED:
|
||||
case ROOM_STATES.JOINED:
|
||||
case ROOM_STATES.MEDIA_WAIT:
|
||||
// this case is so that we don't show an avatar while waiting for
|
||||
// the other party to connect
|
||||
return true;
|
||||
|
||||
case ROOM_STATES.CLOSING:
|
||||
return true;
|
||||
|
||||
default:
|
||||
console.warn("StandaloneRoomView.shouldRenderRemoteVideo:" +
|
||||
console.warn("DesktopRoomConversationView.shouldRenderRemoteVideo:" +
|
||||
" unexpected roomState: ", this.state.roomState);
|
||||
return true;
|
||||
}
|
||||
|
@ -260,8 +260,7 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.standalone .local-stream,
|
||||
.standalone .remote-inset-stream {
|
||||
.standalone .local-stream {
|
||||
/* required to have it superimposed to the control toolbar */
|
||||
z-index: 1001;
|
||||
}
|
||||
@ -554,7 +553,7 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.local .avatar {
|
||||
.conversation .local .avatar {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
@ -647,16 +646,15 @@ html, .fx-embedded, #main,
|
||||
}
|
||||
|
||||
/* We use 641px rather than 640, as min-width and max-width are inclusive */
|
||||
@media screen and (min-width:641px) {
|
||||
.standalone .conversation-toolbar {
|
||||
@media screen and (min-width: 641px) {
|
||||
.standalone .conversation .conversation-toolbar {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.standalone .local-stream,
|
||||
.standalone .remote-inset-stream {
|
||||
.standalone .conversation .local-stream {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
@ -701,11 +699,7 @@ html, .fx-embedded, #main,
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.standalone .remote-inset-stream {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.standalone .local-stream {
|
||||
.standalone .conversation .local-stream {
|
||||
flex: 1;
|
||||
min-width: 120px;
|
||||
min-height: 150px;
|
||||
@ -753,29 +747,42 @@ html, .fx-embedded, #main,
|
||||
background: #000;
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
width: 75%;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .room-conversation-wrapper header {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.room-conversation-wrapper header h1 {
|
||||
font-size: 1.5em;
|
||||
color: #fff;
|
||||
line-height: 50px;
|
||||
text-indent: 60px;
|
||||
text-indent: 40px;
|
||||
background-image: url("../img/firefox-logo.png");
|
||||
background-size: 30px;
|
||||
background-position: 20px;
|
||||
background-position: 0 center;
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .room-conversation-wrapper header h1 {
|
||||
background-position: 100% center;
|
||||
}
|
||||
|
||||
.room-conversation-wrapper header a {
|
||||
float: right;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .room-conversation-wrapper header a {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.room-conversation-wrapper header .icon-help {
|
||||
display: inline-block;
|
||||
background-size: contain;
|
||||
margin-top: 20px;
|
||||
margin-top: 15px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: transparent url("../img/svg/glyph-help-16x16.svg") no-repeat;
|
||||
@ -885,6 +892,7 @@ body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
padding-bottom: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
background-color: #E8F6FE;
|
||||
}
|
||||
|
||||
@ -1080,6 +1088,198 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
.media-layout {
|
||||
/* 50px is the header, 3em is the footer. */
|
||||
height: calc(100% - 50px - 3em);
|
||||
}
|
||||
|
||||
.media-layout > .media-wrapper {
|
||||
display: flex;
|
||||
flex-flow: column wrap;
|
||||
/* 64px for .conversation-toolbar */
|
||||
height: calc(100% - 64px);
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.media-wrapper > .focus-stream {
|
||||
/* We want this to be the width, minus 200px which is for the right-side text
|
||||
chat and video displays. */
|
||||
width: calc(100% - 200px);
|
||||
/* 100% height to fill up media-layout, thus forcing other elements into the
|
||||
second column that's 200px wide */
|
||||
height: 100%;
|
||||
background-color: #4E4E4E;
|
||||
}
|
||||
|
||||
.media-wrapper > .remote {
|
||||
/* Works around an issue with object-fit: cover in Google Chrome - it doesn't
|
||||
currently crop but overlaps the surrounding elements.
|
||||
https://code.google.com/p/chromium/issues/detail?id=400829 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.media-wrapper > .remote > .remote-video {
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* Note: we can't use flex for the text-chat-view as this lets it overflow
|
||||
the expected column heights, and we ca't fix its height. */
|
||||
.media-wrapper > .text-chat-view {
|
||||
flex: 0 0 auto;
|
||||
/* Text chat is a fixed 200px width for normal displays. */
|
||||
width: 200px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.media-wrapper.showing-local-streams > .text-chat-view {
|
||||
/* When we're displaying the local streams, then we need to make the text
|
||||
chat view a bit shorter to give room. */
|
||||
height: calc(100% - 150px);
|
||||
}
|
||||
|
||||
.media-wrapper.showing-local-streams.receiving-screen-share > .text-chat-view {
|
||||
/* When we're displaying the local streams, then we need to make the text
|
||||
chat view a bit shorter to give room. */
|
||||
height: calc(100% - 300px);
|
||||
}
|
||||
|
||||
.media-wrapper > .text-chat-view > .text-chat-entries {
|
||||
/* 40px is the height of .text-chat-box. */
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
.media-wrapper > .local {
|
||||
flex: 0 1 auto;
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .screen {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .text-chat-view {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .remote {
|
||||
order: 3;
|
||||
flex: 0 1 auto;
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .local {
|
||||
order: 4;
|
||||
}
|
||||
|
||||
@media screen and (max-width:640px) {
|
||||
.media-layout {
|
||||
/* 50px is height of header, 25px is height of footer. */
|
||||
height: calc(100% - 50px - 25px);
|
||||
}
|
||||
|
||||
.media-layout > .media-wrapper {
|
||||
flex-direction: row;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
/* conversation toolbar is 38px in narrow mode */
|
||||
height: calc(100% - 38px);
|
||||
}
|
||||
|
||||
.media-wrapper > .focus-stream {
|
||||
width: 100%;
|
||||
/* A reasonable height */
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .focus-stream {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.media-wrapper > .text-chat-view > .text-chat-entries {
|
||||
/* 40px is the height of .text-chat-box. */
|
||||
height: calc(100% - 40px);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.media-wrapper > .local {
|
||||
/* Position over the remote video */
|
||||
position: absolute;
|
||||
/* Make sure its on top */
|
||||
z-index: 1001;
|
||||
margin: 3px;
|
||||
right: 0;
|
||||
/* 29px is (30% of 50px high header) + (height toolbar (38px) +
|
||||
height footer (25px) - height header (50px)) */
|
||||
bottom: calc(30% + 29px);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .media-wrapper > .local {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.media-wrapper > .text-chat-view {
|
||||
order: 3;
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.media-wrapper > .text-chat-view,
|
||||
.media-wrapper.showing-local-streams > .text-chat-view,
|
||||
.media-wrapper.showing-local-streams.receiving-screen-share > .text-chat-view {
|
||||
/* The remaining 30% that the .focus-stream doesn't use. */
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .screen {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .remote {
|
||||
/* Screen shares have remote & local video side-by-side on narrow screens */
|
||||
order: 2;
|
||||
flex: 1 1 auto;
|
||||
height: 20%;
|
||||
/* Ensure no previously specified widths take effect, and we take up no more
|
||||
than half the width. */
|
||||
width: auto;
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .remote > .remote-video {
|
||||
/* Reset the object-fit for this. */
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .local {
|
||||
/* Screen shares have remote & local video side-by-side on narrow screens */
|
||||
order: 3;
|
||||
flex: 1 1 auto;
|
||||
height: 20%;
|
||||
/* Ensure no previously specified widths take effect, and we take up no more
|
||||
than half the width. */
|
||||
width: auto;
|
||||
max-width: 50%;
|
||||
/* This cancels out the absolute positioning when it's just remote video. */
|
||||
position: relative;
|
||||
bottom: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .text-chat-view {
|
||||
order: 4;
|
||||
}
|
||||
}
|
||||
|
||||
.standalone > #main > .room-conversation-wrapper > .media-layout > .conversation-toolbar {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Standalone rooms */
|
||||
|
||||
.standalone .room-conversation-wrapper {
|
||||
@ -1108,6 +1308,11 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .standalone .room-conversation-wrapper .room-inner-info-area {
|
||||
right: 25%;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.standalone .prompt-media-message {
|
||||
padding-top: 136px; /* Fallback for browsers that don't support calc() */
|
||||
/* 122px is 2x the intrinsic height of the background-image, and
|
||||
@ -1153,23 +1358,6 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.standalone-room-info {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
right: 10px;
|
||||
/* 20px is 10px for left and right margins. */
|
||||
width: calc(25% - 20px);
|
||||
z-index: 2000000;
|
||||
font-size: 1.2em;
|
||||
padding: .4em;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.standalone-room-info > h2 {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.standalone-context-url {
|
||||
color: #fff;
|
||||
/* Try and keep clear of local video */
|
||||
@ -1243,7 +1431,7 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
padding: .7em .5em 0;
|
||||
}
|
||||
|
||||
.fx-embedded .text-chat-box {
|
||||
.text-chat-box {
|
||||
flex: 0 0 auto;
|
||||
max-height: 40px;
|
||||
min-height: 40px;
|
||||
@ -1309,20 +1497,6 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
}
|
||||
|
||||
@media screen and (max-width:640px) {
|
||||
.standalone-room-info {
|
||||
/* This isn't perfect, we just center the heading for now. Bug 1141493
|
||||
should fix this. */
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
right: 0px;
|
||||
|
||||
/* Override the 100% specified in the .standalone-room-info selector
|
||||
block so that this div doesn't take over the _whole_ screen and
|
||||
transparently occlude UI widgetry (like the Join button), making
|
||||
it unusable. */
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.standalone-context-url {
|
||||
/* XXX We haven't got UX for standalone yet, so temporarily not displaying
|
||||
on narrow window widths. See bug 1153827. */
|
||||
@ -1333,9 +1507,7 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
.standalone .room-conversation {
|
||||
background: #000;
|
||||
}
|
||||
.room-conversation-wrapper header {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.standalone .room-conversation-wrapper .room-inner-info-area {
|
||||
right: 0;
|
||||
margin: auto;
|
||||
@ -1357,7 +1529,7 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
height: 38px;
|
||||
padding: 8px;
|
||||
}
|
||||
.standalone .focus-stream {
|
||||
.standalone .conversation .focus-stream {
|
||||
/* Set at maximum height, minus height of conversation toolbar */
|
||||
height: 100%;
|
||||
}
|
||||
@ -1418,8 +1590,6 @@ html[dir="rtl"] .room-context-btn-edit {
|
||||
.remote-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.screen-share-video {
|
||||
|
@ -169,6 +169,7 @@ loop.shared.actions = (function() {
|
||||
* Used to notify that the session has a data channel available.
|
||||
*/
|
||||
DataChannelsAvailable: Action.define("dataChannelsAvailable", {
|
||||
available: Boolean
|
||||
}),
|
||||
|
||||
/**
|
||||
|
@ -287,16 +287,8 @@ loop.shared.mixins = (function() {
|
||||
* elements and handling updates of the media containers.
|
||||
*/
|
||||
var MediaSetupMixin = {
|
||||
|
||||
componentDidMount: function() {
|
||||
this.resetDimensionsCache();
|
||||
rootObject.addEventListener("orientationchange", this.updateVideoContainer);
|
||||
rootObject.addEventListener("resize", this.updateVideoContainer);
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
rootObject.removeEventListener("orientationchange", this.updateVideoContainer);
|
||||
rootObject.removeEventListener("resize", this.updateVideoContainer);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -274,6 +274,10 @@ loop.OTSdkDriver = (function() {
|
||||
disconnectSession: function() {
|
||||
this.endScreenShare();
|
||||
|
||||
this.dispatcher.dispatch(new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
|
||||
if (this.session) {
|
||||
this.session.off("sessionDisconnected streamCreated streamDestroyed connectionCreated connectionDestroyed streamPropertyChanged");
|
||||
this.session.disconnect();
|
||||
@ -295,6 +299,8 @@ loop.OTSdkDriver = (function() {
|
||||
delete this._publishedLocalStream;
|
||||
delete this._subscribedRemoteStream;
|
||||
delete this._mockPublisherEl;
|
||||
delete this._publisherChannel;
|
||||
delete this._subscriberChannel;
|
||||
this.connections = {};
|
||||
this._setTwoWayMediaStartTime(this.CONNECTION_START_TIME_UNINITIALIZED);
|
||||
},
|
||||
@ -723,7 +729,9 @@ loop.OTSdkDriver = (function() {
|
||||
*/
|
||||
_checkDataChannelsAvailable: function() {
|
||||
if (this._publisherChannel && this._subscriberChannel) {
|
||||
this.dispatcher.dispatch(new sharedActions.DataChannelsAvailable());
|
||||
this.dispatcher.dispatch(new sharedActions.DataChannelsAvailable({
|
||||
available: true
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
@ -821,6 +829,10 @@ loop.OTSdkDriver = (function() {
|
||||
this._notifyMetricsEvent("Session.streamDestroyed");
|
||||
|
||||
if (event.stream.videoType !== "screen") {
|
||||
this.dispatcher.dispatch(new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
delete this._subscriberChannel;
|
||||
delete this._mockSubscribeEl;
|
||||
return;
|
||||
}
|
||||
@ -839,6 +851,10 @@ loop.OTSdkDriver = (function() {
|
||||
*/
|
||||
_onLocalStreamDestroyed: function() {
|
||||
this._notifyMetricsEvent("Publisher.streamDestroyed");
|
||||
this.dispatcher.dispatch(new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
delete this._publisherChannel;
|
||||
delete this._mockPublisherEl;
|
||||
},
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
var loop = loop || {};
|
||||
loop.store = loop.store || {};
|
||||
|
||||
loop.store.TextChatStore = (function(mozL10n) {
|
||||
loop.store.TextChatStore = (function() {
|
||||
"use strict";
|
||||
|
||||
var sharedActions = loop.shared.actions;
|
||||
@ -69,10 +69,15 @@ loop.store.TextChatStore = (function(mozL10n) {
|
||||
/**
|
||||
* Handles information for when data channels are available - enables
|
||||
* text chat.
|
||||
*
|
||||
* @param {sharedActions.DataChannelsAvailable} actionData
|
||||
*/
|
||||
dataChannelsAvailable: function() {
|
||||
this.setStoreState({ textChatEnabled: true });
|
||||
window.dispatchEvent(new CustomEvent("LoopChatEnabled"));
|
||||
dataChannelsAvailable: function(actionData) {
|
||||
this.setStoreState({ textChatEnabled: actionData.available });
|
||||
|
||||
if (actionData.available) {
|
||||
window.dispatchEvent(new CustomEvent("LoopChatEnabled"));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -137,13 +142,15 @@ loop.store.TextChatStore = (function(mozL10n) {
|
||||
updateRoomInfo: function(actionData) {
|
||||
// XXX When we add special messages to desktop, we'll need to not post
|
||||
// multiple changes of room name, only the first. Bug 1171940 should fix this.
|
||||
this._appendTextChatMessage(CHAT_MESSAGE_TYPES.SPECIAL, {
|
||||
contentType: CHAT_CONTENT_TYPES.ROOM_NAME,
|
||||
message: mozL10n.get("rooms_welcome_title", {conversationName: actionData.roomName})
|
||||
});
|
||||
if (actionData.roomName) {
|
||||
this._appendTextChatMessage(CHAT_MESSAGE_TYPES.SPECIAL, {
|
||||
contentType: CHAT_CONTENT_TYPES.ROOM_NAME,
|
||||
message: actionData.roomName
|
||||
});
|
||||
}
|
||||
|
||||
// Append the context if we have any.
|
||||
if ("urls" in actionData && actionData.urls.length) {
|
||||
if (("urls" in actionData) && actionData.urls && actionData.urls.length) {
|
||||
// We only support the first url at the moment.
|
||||
var urlData = actionData.urls[0];
|
||||
|
||||
@ -160,4 +167,4 @@ loop.store.TextChatStore = (function(mozL10n) {
|
||||
});
|
||||
|
||||
return TextChatStore;
|
||||
})(navigator.mozL10n || window.mozL10n);
|
||||
})();
|
||||
|
@ -39,6 +39,22 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
}
|
||||
});
|
||||
|
||||
var TextChatRoomName = React.createClass({displayName: "TextChatRoomName",
|
||||
mixins: [React.addons.PureRenderMixin],
|
||||
|
||||
propTypes: {
|
||||
message: React.PropTypes.string.isRequired
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
React.createElement("div", {className: "text-chat-entry special room-name"},
|
||||
React.createElement("p", null, mozL10n.get("rooms_welcome_title", {conversationName: this.props.message}))
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Manages the text entries in the chat entries view. This is split out from
|
||||
* TextChatView so that scrolling can be managed more efficiently - this
|
||||
@ -81,21 +97,28 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
React.createElement("div", {className: "text-chat-scroller"},
|
||||
|
||||
this.props.messageList.map(function(entry, i) {
|
||||
if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL &&
|
||||
entry.contentType === CHAT_CONTENT_TYPES.CONTEXT) {
|
||||
return (
|
||||
React.createElement("div", {className: "context-url-view-wrapper"},
|
||||
React.createElement(sharedViews.ContextUrlView, {
|
||||
allowClick: true,
|
||||
description: entry.message,
|
||||
dispatcher: this.props.dispatcher,
|
||||
key: i,
|
||||
showContextTitle: true,
|
||||
thumbnail: entry.extraData.thumbnail,
|
||||
url: entry.extraData.location,
|
||||
useDesktopPaths: false})
|
||||
)
|
||||
);
|
||||
if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL) {
|
||||
switch (entry.contentType) {
|
||||
case CHAT_CONTENT_TYPES.ROOM_NAME:
|
||||
return React.createElement(TextChatRoomName, {message: entry.message});
|
||||
case CHAT_CONTENT_TYPES.CONTEXT:
|
||||
return (
|
||||
React.createElement("div", {className: "context-url-view-wrapper"},
|
||||
React.createElement(sharedViews.ContextUrlView, {
|
||||
allowClick: true,
|
||||
description: entry.message,
|
||||
dispatcher: this.props.dispatcher,
|
||||
key: i,
|
||||
showContextTitle: true,
|
||||
thumbnail: entry.extraData.thumbnail,
|
||||
url: entry.extraData.location,
|
||||
useDesktopPaths: false})
|
||||
)
|
||||
);
|
||||
default:
|
||||
console.error("Unsupported contentType", entry.contentType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -158,6 +181,11 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
handleFormSubmit: function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Don't send empty messages.
|
||||
if (!this.state.messageDetail) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.props.dispatcher.dispatch(new sharedActions.SendTextChatMessage({
|
||||
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||
message: this.state.messageDetail
|
||||
|
@ -39,6 +39,22 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
}
|
||||
});
|
||||
|
||||
var TextChatRoomName = React.createClass({
|
||||
mixins: [React.addons.PureRenderMixin],
|
||||
|
||||
propTypes: {
|
||||
message: React.PropTypes.string.isRequired
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className="text-chat-entry special room-name">
|
||||
<p>{mozL10n.get("rooms_welcome_title", {conversationName: this.props.message})}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Manages the text entries in the chat entries view. This is split out from
|
||||
* TextChatView so that scrolling can be managed more efficiently - this
|
||||
@ -81,21 +97,28 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
<div className="text-chat-scroller">
|
||||
{
|
||||
this.props.messageList.map(function(entry, i) {
|
||||
if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL &&
|
||||
entry.contentType === CHAT_CONTENT_TYPES.CONTEXT) {
|
||||
return (
|
||||
<div className="context-url-view-wrapper">
|
||||
<sharedViews.ContextUrlView
|
||||
allowClick={true}
|
||||
description={entry.message}
|
||||
dispatcher={this.props.dispatcher}
|
||||
key={i}
|
||||
showContextTitle={true}
|
||||
thumbnail={entry.extraData.thumbnail}
|
||||
url={entry.extraData.location}
|
||||
useDesktopPaths={false} />
|
||||
</div>
|
||||
);
|
||||
if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL) {
|
||||
switch (entry.contentType) {
|
||||
case CHAT_CONTENT_TYPES.ROOM_NAME:
|
||||
return <TextChatRoomName message={entry.message}/>;
|
||||
case CHAT_CONTENT_TYPES.CONTEXT:
|
||||
return (
|
||||
<div className="context-url-view-wrapper">
|
||||
<sharedViews.ContextUrlView
|
||||
allowClick={true}
|
||||
description={entry.message}
|
||||
dispatcher={this.props.dispatcher}
|
||||
key={i}
|
||||
showContextTitle={true}
|
||||
thumbnail={entry.extraData.thumbnail}
|
||||
url={entry.extraData.location}
|
||||
useDesktopPaths={false} />
|
||||
</div>
|
||||
);
|
||||
default:
|
||||
console.error("Unsupported contentType", entry.contentType);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -158,6 +181,11 @@ loop.shared.views.TextChatView = (function(mozL10n) {
|
||||
handleFormSubmit: function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Don't send empty messages.
|
||||
if (!this.state.messageDetail) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.props.dispatcher.dispatch(new sharedActions.SendTextChatMessage({
|
||||
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||
message: this.state.messageDetail
|
||||
|
@ -633,6 +633,15 @@ loop.shared.views = (function(_, l10n) {
|
||||
};
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
// Only change the state if the prop has changed, and if it is also
|
||||
// different from the state.
|
||||
if (this.props.checked !== nextProps.checked &&
|
||||
this.state.checked !== nextProps.checked) {
|
||||
this.setState({ checked: nextProps.checked });
|
||||
}
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
checked: this.props.checked,
|
||||
|
@ -633,6 +633,15 @@ loop.shared.views = (function(_, l10n) {
|
||||
};
|
||||
},
|
||||
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
// Only change the state if the prop has changed, and if it is also
|
||||
// different from the state.
|
||||
if (this.props.checked !== nextProps.checked &&
|
||||
this.state.checked !== nextProps.checked) {
|
||||
this.setState({ checked: nextProps.checked });
|
||||
}
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
checked: this.props.checked,
|
||||
|
@ -129,7 +129,7 @@ body,
|
||||
|
||||
.rooms-footer {
|
||||
background: #000;
|
||||
margin: 0 20px;
|
||||
margin: 0 10px;
|
||||
text-align: left;
|
||||
height: 3em;
|
||||
position: relative;
|
||||
@ -354,34 +354,16 @@ p.standalone-btn-label {
|
||||
right: 35%;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .standalone .room-conversation-wrapper .ended-conversation .feedback {
|
||||
right: auto;
|
||||
left: 35%;
|
||||
}
|
||||
|
||||
.standalone .ended-conversation .local-stream {
|
||||
/* Hide local media stream when feedback form is shown. */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* The .text-chat-* styles are very temporarily whilst we work on text chat
|
||||
* (bug 1108892 and dependencies).
|
||||
*/
|
||||
.text-chat-view {
|
||||
height: 60px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.text-chat-entries {
|
||||
/* XXX Should use flex, this is just for the initial implementation. */
|
||||
height: calc(100% - 2em);
|
||||
}
|
||||
|
||||
.text-chat-box {
|
||||
width: 30%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.text-chat-box > form > input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media screen and (max-width:640px) {
|
||||
.standalone .ended-conversation .feedback {
|
||||
width: 92%;
|
||||
|
@ -229,106 +229,12 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomContextItem = React.createClass({displayName: "StandaloneRoomContextItem",
|
||||
propTypes: {
|
||||
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
|
||||
receivingScreenShare: React.PropTypes.bool,
|
||||
roomContextUrl: React.PropTypes.object
|
||||
},
|
||||
|
||||
recordClick: function() {
|
||||
this.props.dispatcher.dispatch(new sharedActions.RecordClick({
|
||||
linkInfo: "Shared URL"
|
||||
}));
|
||||
},
|
||||
|
||||
render: function() {
|
||||
if (!this.props.roomContextUrl ||
|
||||
!this.props.roomContextUrl.location) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var locationInfo = sharedUtils.formatURL(this.props.roomContextUrl.location);
|
||||
if (!locationInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var cx = React.addons.classSet;
|
||||
|
||||
var classes = cx({
|
||||
"standalone-context-url": true,
|
||||
"screen-share-active": this.props.receivingScreenShare
|
||||
});
|
||||
|
||||
return (
|
||||
React.createElement("div", {className: classes},
|
||||
React.createElement("img", {src: this.props.roomContextUrl.thumbnail || "shared/img/icons-16x16.svg#globe"}),
|
||||
React.createElement("div", {className: "standalone-context-url-description-wrapper"},
|
||||
this.props.roomContextUrl.description,
|
||||
React.createElement("br", null), React.createElement("a", {href: locationInfo.location,
|
||||
onClick: this.recordClick,
|
||||
target: "_blank",
|
||||
title: locationInfo.location}, locationInfo.hostname)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomContextView = React.createClass({displayName: "StandaloneRoomContextView",
|
||||
propTypes: {
|
||||
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
|
||||
receivingScreenShare: React.PropTypes.bool.isRequired,
|
||||
roomContextUrls: React.PropTypes.array,
|
||||
roomName: React.PropTypes.string,
|
||||
roomInfoFailure: React.PropTypes.string
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
failureLogged: false
|
||||
};
|
||||
},
|
||||
|
||||
_logFailure: function(message) {
|
||||
if (!this.state.failureLogged) {
|
||||
console.error(mozL10n.get(message));
|
||||
this.state.failureLogged = true;
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
// For failures, we currently just log the messages - UX doesn't want them
|
||||
// displayed on primary UI at the moment.
|
||||
if (this.props.roomInfoFailure === ROOM_INFO_FAILURES.WEB_CRYPTO_UNSUPPORTED) {
|
||||
this._logFailure("room_information_failure_unsupported_browser");
|
||||
return null;
|
||||
} else if (this.props.roomInfoFailure) {
|
||||
this._logFailure("room_information_failure_not_available");
|
||||
return null;
|
||||
}
|
||||
|
||||
// We only support one item in the context Urls array for now.
|
||||
var roomContextUrl = (this.props.roomContextUrls &&
|
||||
this.props.roomContextUrls.length > 0) ?
|
||||
this.props.roomContextUrls[0] : null;
|
||||
return (
|
||||
React.createElement("div", {className: "standalone-room-info"},
|
||||
React.createElement("h2", {className: "room-name"}, this.props.roomName),
|
||||
React.createElement(StandaloneRoomContextItem, {
|
||||
dispatcher: this.props.dispatcher,
|
||||
receivingScreenShare: this.props.receivingScreenShare,
|
||||
roomContextUrl: roomContextUrl})
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomView = React.createClass({displayName: "StandaloneRoomView",
|
||||
mixins: [
|
||||
Backbone.Events,
|
||||
sharedMixins.MediaSetupMixin,
|
||||
sharedMixins.RoomsAudioMixin
|
||||
sharedMixins.RoomsAudioMixin,
|
||||
loop.store.StoreMixin("activeRoomStore")
|
||||
],
|
||||
|
||||
propTypes: {
|
||||
@ -352,32 +258,11 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
});
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
this.listenTo(this.props.activeRoomStore, "change",
|
||||
this._onActiveRoomStateChanged);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles a "change" event on the roomStore, and updates this.state
|
||||
* to match the store.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_onActiveRoomStateChanged: function() {
|
||||
var state = this.props.activeRoomStore.getStoreState();
|
||||
this.updateVideoDimensions(state.localVideoDimensions, state.remoteVideoDimensions);
|
||||
this.setState(state);
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
// Adding a class to the document body element from here to ease styling it.
|
||||
document.body.classList.add("is-standalone-room");
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this.stopListening(this.props.activeRoomStore);
|
||||
},
|
||||
|
||||
/**
|
||||
* Watches for when we transition to MEDIA_WAIT room state, so we can request
|
||||
* user media access.
|
||||
@ -393,30 +278,16 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}));
|
||||
}
|
||||
|
||||
if (this.state.roomState !== ROOM_STATES.JOINED &&
|
||||
nextState.roomState === ROOM_STATES.JOINED) {
|
||||
// This forces the video size to update - creating the publisher
|
||||
// first, and then connecting to the session doesn't seem to set the
|
||||
// initial size correctly.
|
||||
this.updateVideoContainer();
|
||||
}
|
||||
|
||||
if (nextState.roomState === ROOM_STATES.INIT ||
|
||||
nextState.roomState === ROOM_STATES.GATHER ||
|
||||
nextState.roomState === ROOM_STATES.READY) {
|
||||
this.resetDimensionsCache();
|
||||
}
|
||||
|
||||
// When screen sharing stops.
|
||||
if (this.state.receivingScreenShare && !nextState.receivingScreenShare) {
|
||||
// Remove the custom screenshare styles on the remote camera.
|
||||
var node = this._getElement(".remote");
|
||||
node.removeAttribute("style");
|
||||
}
|
||||
|
||||
if (this.state.receivingScreenShare != nextState.receivingScreenShare ||
|
||||
this.state.remoteVideoEnabled != nextState.remoteVideoEnabled) {
|
||||
this.updateVideoContainer();
|
||||
// UX don't want to surface these errors (as they would imply the user
|
||||
// needs to do something to fix them, when if they're having a conversation
|
||||
// they just need to connect). However, we do want there to be somewhere to
|
||||
// find reasonably easily, in case there's issues raised.
|
||||
if (!this.state.roomInfoFailure && nextState.roomInfoFailure) {
|
||||
if (nextState.roomInfoFailure === ROOM_INFO_FAILURES.WEB_CRYPTO_UNSUPPORTED) {
|
||||
console.error(mozL10n.get("room_information_failure_unsupported_browser"));
|
||||
} else {
|
||||
console.error(mozL10n.get("room_information_failure_not_available"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -428,32 +299,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
this.props.dispatcher.dispatch(new sharedActions.LeaveRoom());
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper for window.matchMedia so that we use an appropriate version
|
||||
* for the ui-showcase, which puts views inside of their own iframes.
|
||||
*
|
||||
* Currently, we use an icky hack, and the showcase conspires with
|
||||
* react-frame-component to set iframe.contentWindow.matchMedia onto
|
||||
* activeRoomStore. Once React context matures a bit (somewhere between
|
||||
* 0.14 and 1.0, apparently):
|
||||
*
|
||||
* https://facebook.github.io/react/blog/2015/02/24/streamlining-react-elements.html#solution-make-context-parent-based-instead-of-owner-based
|
||||
*
|
||||
* we should be able to use those to clean this up.
|
||||
*
|
||||
* @param queryString
|
||||
* @returns {MediaQueryList|null}
|
||||
* @private
|
||||
*/
|
||||
_matchMedia: function(queryString) {
|
||||
if ("matchMedia" in this.state) {
|
||||
return this.state.matchMedia(queryString);
|
||||
} else if ("matchMedia" in window) {
|
||||
return window.matchMedia(queryString);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggles streaming status for a given stream type.
|
||||
*
|
||||
@ -467,131 +312,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}));
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifically updates the local camera stream size and position, depending
|
||||
* on the size and position of the remote video stream.
|
||||
* This method gets called from `updateVideoContainer`, which is defined in
|
||||
* the `MediaSetupMixin`.
|
||||
*
|
||||
* @param {Object} ratio Aspect ratio of the local camera stream
|
||||
*/
|
||||
updateLocalCameraPosition: function(ratio) {
|
||||
// The local stream is a quarter of the remote stream.
|
||||
var LOCAL_STREAM_SIZE = 0.25;
|
||||
// The local stream overlaps the remote stream by a quarter of the local stream.
|
||||
var LOCAL_STREAM_OVERLAP = 0.25;
|
||||
// The minimum size of video height/width allowed by the sdk css.
|
||||
var SDK_MIN_SIZE = 48;
|
||||
|
||||
var node = this._getElement(".local");
|
||||
var targetWidth;
|
||||
|
||||
node.style.right = "auto";
|
||||
if (this._matchMedia("screen and (max-width:640px)").matches) {
|
||||
// For reduced screen widths, we just go for a fixed size and no overlap.
|
||||
targetWidth = 180;
|
||||
node.style.width = (targetWidth * ratio.width) + "px";
|
||||
node.style.height = (targetWidth * ratio.height) + "px";
|
||||
node.style.left = "auto";
|
||||
} else {
|
||||
// The local camera view should be a quarter of the size of the remote stream
|
||||
// and positioned to overlap with the remote stream at a quarter of its width.
|
||||
|
||||
// Now position the local camera view correctly with respect to the remote
|
||||
// video stream or the screen share stream.
|
||||
var remoteVideoDimensions;
|
||||
var isScreenShare = this.state.receivingScreenShare;
|
||||
var videoDisplayed = isScreenShare ?
|
||||
this.state.screenShareVideoObject || this.props.screenSharePosterUrl :
|
||||
this.state.remoteSrcVideoObject || this.props.remotePosterUrl;
|
||||
|
||||
if ((isScreenShare || this.shouldRenderRemoteVideo()) && videoDisplayed) {
|
||||
remoteVideoDimensions = this.getRemoteVideoDimensions(
|
||||
isScreenShare ? "screen" : "camera");
|
||||
} else {
|
||||
var remoteElement = this.getDOMNode().querySelector(".remote.focus-stream");
|
||||
if (!remoteElement) {
|
||||
return;
|
||||
}
|
||||
remoteVideoDimensions = {
|
||||
streamWidth: remoteElement.offsetWidth,
|
||||
offsetX: remoteElement.offsetLeft
|
||||
};
|
||||
}
|
||||
|
||||
targetWidth = remoteVideoDimensions.streamWidth * LOCAL_STREAM_SIZE;
|
||||
|
||||
var realWidth = targetWidth * ratio.width;
|
||||
var realHeight = targetWidth * ratio.height;
|
||||
|
||||
// If we've hit the min size limits, then limit at the minimum.
|
||||
if (realWidth < SDK_MIN_SIZE) {
|
||||
realWidth = SDK_MIN_SIZE;
|
||||
realHeight = realWidth / ratio.width * ratio.height;
|
||||
}
|
||||
if (realHeight < SDK_MIN_SIZE) {
|
||||
realHeight = SDK_MIN_SIZE;
|
||||
realWidth = realHeight / ratio.height * ratio.width;
|
||||
}
|
||||
|
||||
var offsetX = (remoteVideoDimensions.streamWidth + remoteVideoDimensions.offsetX);
|
||||
// The horizontal offset of the stream, and the width of the resulting
|
||||
// pillarbox, is determined by the height exponent of the aspect ratio.
|
||||
// Therefore we multiply the width of the local camera view by the height
|
||||
// ratio.
|
||||
node.style.left = (offsetX - (realWidth * LOCAL_STREAM_OVERLAP)) + "px";
|
||||
node.style.width = realWidth + "px";
|
||||
node.style.height = realHeight + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifically updates the remote camera stream size and position, if
|
||||
* a screen share is being received. It is slaved from the position of the
|
||||
* local stream.
|
||||
* This method gets called from `updateVideoContainer`, which is defined in
|
||||
* the `MediaSetupMixin`.
|
||||
*
|
||||
* @param {Object} ratio Aspect ratio of the remote camera stream
|
||||
*/
|
||||
updateRemoteCameraPosition: function(ratio) {
|
||||
// Nothing to do for screenshare
|
||||
if (!this.state.receivingScreenShare) {
|
||||
return;
|
||||
}
|
||||
// XXX For the time being, if we're a narrow screen, aka mobile, we don't display
|
||||
// the remote media (bug 1133534).
|
||||
if (this._matchMedia("screen and (max-width:640px)").matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 10px separation between the two streams.
|
||||
var LOCAL_REMOTE_SEPARATION = 10;
|
||||
|
||||
var node = this._getElement(".remote");
|
||||
var localNode = this._getElement(".local");
|
||||
|
||||
// Match the width to the local video.
|
||||
node.style.width = localNode.offsetWidth + "px";
|
||||
|
||||
// The height is then determined from the aspect ratio
|
||||
var height = ((localNode.offsetWidth / ratio.width) * ratio.height);
|
||||
node.style.height = height + "px";
|
||||
|
||||
node.style.right = "auto";
|
||||
node.style.bottom = "auto";
|
||||
|
||||
// Now position the local camera view correctly with respect to the remote
|
||||
// video stream.
|
||||
|
||||
// The top is measured from the top of the element down the screen,
|
||||
// so subtract the height of the video and the separation distance.
|
||||
node.style.top = (localNode.offsetTop - height - LOCAL_REMOTE_SEPARATION) + "px";
|
||||
|
||||
// Match the left-hand sides.
|
||||
node.style.left = localNode.offsetLeft + "px";
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if current room is active.
|
||||
*
|
||||
@ -647,34 +367,29 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var localStreamClasses = React.addons.classSet({
|
||||
local: true,
|
||||
"local-stream": true,
|
||||
"local-stream-audio": this.state.videoMuted
|
||||
});
|
||||
var displayScreenShare = this.state.receivingScreenShare ||
|
||||
this.props.screenSharePosterUrl;
|
||||
|
||||
var remoteStreamClasses = React.addons.classSet({
|
||||
"video_inner": true,
|
||||
"remote": true,
|
||||
"focus-stream": !this.state.receivingScreenShare,
|
||||
"remote-inset-stream": this.state.receivingScreenShare
|
||||
"focus-stream": !displayScreenShare
|
||||
});
|
||||
|
||||
var screenShareStreamClasses = React.addons.classSet({
|
||||
"screen": true,
|
||||
"focus-stream": this.state.receivingScreenShare,
|
||||
hide: !this.state.receivingScreenShare
|
||||
"focus-stream": displayScreenShare
|
||||
});
|
||||
|
||||
var mediaWrapperClasses = React.addons.classSet({
|
||||
"media-wrapper": true,
|
||||
"receiving-screen-share": displayScreenShare,
|
||||
"showing-local-streams": this.state.localSrcVideoObject ||
|
||||
this.props.localPosterUrl
|
||||
});
|
||||
|
||||
// XXX Temporarily showAlways = showRoomName = false for TextChatView
|
||||
// until bug 1168829 is completed.
|
||||
return (
|
||||
React.createElement("div", {className: "room-conversation-wrapper"},
|
||||
React.createElement("div", {className: "beta-logo"}),
|
||||
React.createElement(sharedViews.TextChatView, {
|
||||
dispatcher: this.props.dispatcher,
|
||||
showAlways: false,
|
||||
showRoomName: false}),
|
||||
React.createElement(StandaloneRoomHeader, {dispatcher: this.props.dispatcher}),
|
||||
React.createElement(StandaloneRoomInfoArea, {roomState: this.state.roomState,
|
||||
failureReason: this.state.failureReason,
|
||||
@ -682,50 +397,44 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
isFirefox: this.props.isFirefox,
|
||||
activeRoomStore: this.props.activeRoomStore,
|
||||
roomUsed: this.state.used}),
|
||||
React.createElement("div", {className: "video-layout-wrapper"},
|
||||
React.createElement("div", {className: "conversation room-conversation"},
|
||||
React.createElement(StandaloneRoomContextView, {
|
||||
dispatcher: this.props.dispatcher,
|
||||
receivingScreenShare: this.state.receivingScreenShare,
|
||||
roomContextUrls: this.state.roomContextUrls,
|
||||
roomName: this.state.roomName,
|
||||
roomInfoFailure: this.state.roomInfoFailure}),
|
||||
React.createElement("div", {className: "media nested"},
|
||||
React.createElement("span", {className: "self-view-hidden-message"},
|
||||
mozL10n.get("self_view_hidden_message")
|
||||
),
|
||||
React.createElement("div", {className: "video_wrapper remote_wrapper"},
|
||||
React.createElement("div", {className: remoteStreamClasses},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: !this.shouldRenderRemoteVideo(),
|
||||
posterUrl: this.props.remotePosterUrl,
|
||||
mediaType: "remote",
|
||||
srcVideoObject: this.state.remoteSrcVideoObject})
|
||||
),
|
||||
React.createElement("div", {className: screenShareStreamClasses},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: false,
|
||||
posterUrl: this.props.screenSharePosterUrl,
|
||||
mediaType: "screen-share",
|
||||
srcVideoObject: this.state.screenShareVideoObject})
|
||||
)
|
||||
),
|
||||
React.createElement("div", {className: localStreamClasses},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: this.state.videoMuted,
|
||||
posterUrl: this.props.localPosterUrl,
|
||||
mediaType: "local",
|
||||
srcVideoObject: this.state.localSrcVideoObject})
|
||||
)
|
||||
React.createElement("div", {className: "media-layout"},
|
||||
React.createElement("div", {className: mediaWrapperClasses},
|
||||
React.createElement("span", {className: "self-view-hidden-message"},
|
||||
mozL10n.get("self_view_hidden_message")
|
||||
),
|
||||
React.createElement(sharedViews.ConversationToolbar, {
|
||||
React.createElement("div", {className: remoteStreamClasses},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: !this.shouldRenderRemoteVideo(),
|
||||
posterUrl: this.props.remotePosterUrl,
|
||||
mediaType: "remote",
|
||||
srcVideoObject: this.state.remoteSrcVideoObject})
|
||||
),
|
||||
React.createElement("div", {className: screenShareStreamClasses},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: false,
|
||||
posterUrl: this.props.screenSharePosterUrl,
|
||||
mediaType: "screen-share",
|
||||
srcVideoObject: this.state.screenShareVideoObject})
|
||||
),
|
||||
React.createElement(sharedViews.TextChatView, {
|
||||
dispatcher: this.props.dispatcher,
|
||||
video: {enabled: !this.state.videoMuted,
|
||||
visible: this._roomIsActive()},
|
||||
audio: {enabled: !this.state.audioMuted,
|
||||
visible: this._roomIsActive()},
|
||||
publishStream: this.publishStream,
|
||||
hangup: this.leaveRoom,
|
||||
hangupButtonLabel: mozL10n.get("rooms_leave_button_label"),
|
||||
enableHangup: this._roomIsActive()})
|
||||
)
|
||||
showAlways: true,
|
||||
showRoomName: true}),
|
||||
React.createElement("div", {className: "local"},
|
||||
React.createElement(sharedViews.MediaView, {displayAvatar: this.state.videoMuted,
|
||||
posterUrl: this.props.localPosterUrl,
|
||||
mediaType: "local",
|
||||
srcVideoObject: this.state.localSrcVideoObject})
|
||||
)
|
||||
),
|
||||
React.createElement(sharedViews.ConversationToolbar, {
|
||||
dispatcher: this.props.dispatcher,
|
||||
video: {enabled: !this.state.videoMuted,
|
||||
visible: this._roomIsActive()},
|
||||
audio: {enabled: !this.state.audioMuted,
|
||||
visible: this._roomIsActive()},
|
||||
publishStream: this.publishStream,
|
||||
hangup: this.leaveRoom,
|
||||
hangupButtonLabel: mozL10n.get("rooms_leave_button_label"),
|
||||
enableHangup: this._roomIsActive()})
|
||||
),
|
||||
React.createElement(loop.fxOSMarketplaceViews.FxOSHiddenMarketplaceView, {
|
||||
marketplaceSrc: this.state.marketplaceSrc,
|
||||
@ -737,7 +446,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
});
|
||||
|
||||
return {
|
||||
StandaloneRoomContextView: StandaloneRoomContextView,
|
||||
StandaloneRoomFooter: StandaloneRoomFooter,
|
||||
StandaloneRoomHeader: StandaloneRoomHeader,
|
||||
StandaloneRoomView: StandaloneRoomView
|
||||
|
@ -229,106 +229,12 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomContextItem = React.createClass({
|
||||
propTypes: {
|
||||
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
|
||||
receivingScreenShare: React.PropTypes.bool,
|
||||
roomContextUrl: React.PropTypes.object
|
||||
},
|
||||
|
||||
recordClick: function() {
|
||||
this.props.dispatcher.dispatch(new sharedActions.RecordClick({
|
||||
linkInfo: "Shared URL"
|
||||
}));
|
||||
},
|
||||
|
||||
render: function() {
|
||||
if (!this.props.roomContextUrl ||
|
||||
!this.props.roomContextUrl.location) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var locationInfo = sharedUtils.formatURL(this.props.roomContextUrl.location);
|
||||
if (!locationInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var cx = React.addons.classSet;
|
||||
|
||||
var classes = cx({
|
||||
"standalone-context-url": true,
|
||||
"screen-share-active": this.props.receivingScreenShare
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={classes}>
|
||||
<img src={this.props.roomContextUrl.thumbnail || "shared/img/icons-16x16.svg#globe"} />
|
||||
<div className="standalone-context-url-description-wrapper">
|
||||
{this.props.roomContextUrl.description}
|
||||
<br /><a href={locationInfo.location}
|
||||
onClick={this.recordClick}
|
||||
target="_blank"
|
||||
title={locationInfo.location}>{locationInfo.hostname}</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomContextView = React.createClass({
|
||||
propTypes: {
|
||||
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
|
||||
receivingScreenShare: React.PropTypes.bool.isRequired,
|
||||
roomContextUrls: React.PropTypes.array,
|
||||
roomName: React.PropTypes.string,
|
||||
roomInfoFailure: React.PropTypes.string
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
failureLogged: false
|
||||
};
|
||||
},
|
||||
|
||||
_logFailure: function(message) {
|
||||
if (!this.state.failureLogged) {
|
||||
console.error(mozL10n.get(message));
|
||||
this.state.failureLogged = true;
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
// For failures, we currently just log the messages - UX doesn't want them
|
||||
// displayed on primary UI at the moment.
|
||||
if (this.props.roomInfoFailure === ROOM_INFO_FAILURES.WEB_CRYPTO_UNSUPPORTED) {
|
||||
this._logFailure("room_information_failure_unsupported_browser");
|
||||
return null;
|
||||
} else if (this.props.roomInfoFailure) {
|
||||
this._logFailure("room_information_failure_not_available");
|
||||
return null;
|
||||
}
|
||||
|
||||
// We only support one item in the context Urls array for now.
|
||||
var roomContextUrl = (this.props.roomContextUrls &&
|
||||
this.props.roomContextUrls.length > 0) ?
|
||||
this.props.roomContextUrls[0] : null;
|
||||
return (
|
||||
<div className="standalone-room-info">
|
||||
<h2 className="room-name">{this.props.roomName}</h2>
|
||||
<StandaloneRoomContextItem
|
||||
dispatcher={this.props.dispatcher}
|
||||
receivingScreenShare={this.props.receivingScreenShare}
|
||||
roomContextUrl={roomContextUrl} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var StandaloneRoomView = React.createClass({
|
||||
mixins: [
|
||||
Backbone.Events,
|
||||
sharedMixins.MediaSetupMixin,
|
||||
sharedMixins.RoomsAudioMixin
|
||||
sharedMixins.RoomsAudioMixin,
|
||||
loop.store.StoreMixin("activeRoomStore")
|
||||
],
|
||||
|
||||
propTypes: {
|
||||
@ -352,32 +258,11 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
});
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
this.listenTo(this.props.activeRoomStore, "change",
|
||||
this._onActiveRoomStateChanged);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles a "change" event on the roomStore, and updates this.state
|
||||
* to match the store.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_onActiveRoomStateChanged: function() {
|
||||
var state = this.props.activeRoomStore.getStoreState();
|
||||
this.updateVideoDimensions(state.localVideoDimensions, state.remoteVideoDimensions);
|
||||
this.setState(state);
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
// Adding a class to the document body element from here to ease styling it.
|
||||
document.body.classList.add("is-standalone-room");
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
this.stopListening(this.props.activeRoomStore);
|
||||
},
|
||||
|
||||
/**
|
||||
* Watches for when we transition to MEDIA_WAIT room state, so we can request
|
||||
* user media access.
|
||||
@ -393,30 +278,16 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}));
|
||||
}
|
||||
|
||||
if (this.state.roomState !== ROOM_STATES.JOINED &&
|
||||
nextState.roomState === ROOM_STATES.JOINED) {
|
||||
// This forces the video size to update - creating the publisher
|
||||
// first, and then connecting to the session doesn't seem to set the
|
||||
// initial size correctly.
|
||||
this.updateVideoContainer();
|
||||
}
|
||||
|
||||
if (nextState.roomState === ROOM_STATES.INIT ||
|
||||
nextState.roomState === ROOM_STATES.GATHER ||
|
||||
nextState.roomState === ROOM_STATES.READY) {
|
||||
this.resetDimensionsCache();
|
||||
}
|
||||
|
||||
// When screen sharing stops.
|
||||
if (this.state.receivingScreenShare && !nextState.receivingScreenShare) {
|
||||
// Remove the custom screenshare styles on the remote camera.
|
||||
var node = this._getElement(".remote");
|
||||
node.removeAttribute("style");
|
||||
}
|
||||
|
||||
if (this.state.receivingScreenShare != nextState.receivingScreenShare ||
|
||||
this.state.remoteVideoEnabled != nextState.remoteVideoEnabled) {
|
||||
this.updateVideoContainer();
|
||||
// UX don't want to surface these errors (as they would imply the user
|
||||
// needs to do something to fix them, when if they're having a conversation
|
||||
// they just need to connect). However, we do want there to be somewhere to
|
||||
// find reasonably easily, in case there's issues raised.
|
||||
if (!this.state.roomInfoFailure && nextState.roomInfoFailure) {
|
||||
if (nextState.roomInfoFailure === ROOM_INFO_FAILURES.WEB_CRYPTO_UNSUPPORTED) {
|
||||
console.error(mozL10n.get("room_information_failure_unsupported_browser"));
|
||||
} else {
|
||||
console.error(mozL10n.get("room_information_failure_not_available"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -428,32 +299,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
this.props.dispatcher.dispatch(new sharedActions.LeaveRoom());
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper for window.matchMedia so that we use an appropriate version
|
||||
* for the ui-showcase, which puts views inside of their own iframes.
|
||||
*
|
||||
* Currently, we use an icky hack, and the showcase conspires with
|
||||
* react-frame-component to set iframe.contentWindow.matchMedia onto
|
||||
* activeRoomStore. Once React context matures a bit (somewhere between
|
||||
* 0.14 and 1.0, apparently):
|
||||
*
|
||||
* https://facebook.github.io/react/blog/2015/02/24/streamlining-react-elements.html#solution-make-context-parent-based-instead-of-owner-based
|
||||
*
|
||||
* we should be able to use those to clean this up.
|
||||
*
|
||||
* @param queryString
|
||||
* @returns {MediaQueryList|null}
|
||||
* @private
|
||||
*/
|
||||
_matchMedia: function(queryString) {
|
||||
if ("matchMedia" in this.state) {
|
||||
return this.state.matchMedia(queryString);
|
||||
} else if ("matchMedia" in window) {
|
||||
return window.matchMedia(queryString);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggles streaming status for a given stream type.
|
||||
*
|
||||
@ -467,131 +312,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
}));
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifically updates the local camera stream size and position, depending
|
||||
* on the size and position of the remote video stream.
|
||||
* This method gets called from `updateVideoContainer`, which is defined in
|
||||
* the `MediaSetupMixin`.
|
||||
*
|
||||
* @param {Object} ratio Aspect ratio of the local camera stream
|
||||
*/
|
||||
updateLocalCameraPosition: function(ratio) {
|
||||
// The local stream is a quarter of the remote stream.
|
||||
var LOCAL_STREAM_SIZE = 0.25;
|
||||
// The local stream overlaps the remote stream by a quarter of the local stream.
|
||||
var LOCAL_STREAM_OVERLAP = 0.25;
|
||||
// The minimum size of video height/width allowed by the sdk css.
|
||||
var SDK_MIN_SIZE = 48;
|
||||
|
||||
var node = this._getElement(".local");
|
||||
var targetWidth;
|
||||
|
||||
node.style.right = "auto";
|
||||
if (this._matchMedia("screen and (max-width:640px)").matches) {
|
||||
// For reduced screen widths, we just go for a fixed size and no overlap.
|
||||
targetWidth = 180;
|
||||
node.style.width = (targetWidth * ratio.width) + "px";
|
||||
node.style.height = (targetWidth * ratio.height) + "px";
|
||||
node.style.left = "auto";
|
||||
} else {
|
||||
// The local camera view should be a quarter of the size of the remote stream
|
||||
// and positioned to overlap with the remote stream at a quarter of its width.
|
||||
|
||||
// Now position the local camera view correctly with respect to the remote
|
||||
// video stream or the screen share stream.
|
||||
var remoteVideoDimensions;
|
||||
var isScreenShare = this.state.receivingScreenShare;
|
||||
var videoDisplayed = isScreenShare ?
|
||||
this.state.screenShareVideoObject || this.props.screenSharePosterUrl :
|
||||
this.state.remoteSrcVideoObject || this.props.remotePosterUrl;
|
||||
|
||||
if ((isScreenShare || this.shouldRenderRemoteVideo()) && videoDisplayed) {
|
||||
remoteVideoDimensions = this.getRemoteVideoDimensions(
|
||||
isScreenShare ? "screen" : "camera");
|
||||
} else {
|
||||
var remoteElement = this.getDOMNode().querySelector(".remote.focus-stream");
|
||||
if (!remoteElement) {
|
||||
return;
|
||||
}
|
||||
remoteVideoDimensions = {
|
||||
streamWidth: remoteElement.offsetWidth,
|
||||
offsetX: remoteElement.offsetLeft
|
||||
};
|
||||
}
|
||||
|
||||
targetWidth = remoteVideoDimensions.streamWidth * LOCAL_STREAM_SIZE;
|
||||
|
||||
var realWidth = targetWidth * ratio.width;
|
||||
var realHeight = targetWidth * ratio.height;
|
||||
|
||||
// If we've hit the min size limits, then limit at the minimum.
|
||||
if (realWidth < SDK_MIN_SIZE) {
|
||||
realWidth = SDK_MIN_SIZE;
|
||||
realHeight = realWidth / ratio.width * ratio.height;
|
||||
}
|
||||
if (realHeight < SDK_MIN_SIZE) {
|
||||
realHeight = SDK_MIN_SIZE;
|
||||
realWidth = realHeight / ratio.height * ratio.width;
|
||||
}
|
||||
|
||||
var offsetX = (remoteVideoDimensions.streamWidth + remoteVideoDimensions.offsetX);
|
||||
// The horizontal offset of the stream, and the width of the resulting
|
||||
// pillarbox, is determined by the height exponent of the aspect ratio.
|
||||
// Therefore we multiply the width of the local camera view by the height
|
||||
// ratio.
|
||||
node.style.left = (offsetX - (realWidth * LOCAL_STREAM_OVERLAP)) + "px";
|
||||
node.style.width = realWidth + "px";
|
||||
node.style.height = realHeight + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifically updates the remote camera stream size and position, if
|
||||
* a screen share is being received. It is slaved from the position of the
|
||||
* local stream.
|
||||
* This method gets called from `updateVideoContainer`, which is defined in
|
||||
* the `MediaSetupMixin`.
|
||||
*
|
||||
* @param {Object} ratio Aspect ratio of the remote camera stream
|
||||
*/
|
||||
updateRemoteCameraPosition: function(ratio) {
|
||||
// Nothing to do for screenshare
|
||||
if (!this.state.receivingScreenShare) {
|
||||
return;
|
||||
}
|
||||
// XXX For the time being, if we're a narrow screen, aka mobile, we don't display
|
||||
// the remote media (bug 1133534).
|
||||
if (this._matchMedia("screen and (max-width:640px)").matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 10px separation between the two streams.
|
||||
var LOCAL_REMOTE_SEPARATION = 10;
|
||||
|
||||
var node = this._getElement(".remote");
|
||||
var localNode = this._getElement(".local");
|
||||
|
||||
// Match the width to the local video.
|
||||
node.style.width = localNode.offsetWidth + "px";
|
||||
|
||||
// The height is then determined from the aspect ratio
|
||||
var height = ((localNode.offsetWidth / ratio.width) * ratio.height);
|
||||
node.style.height = height + "px";
|
||||
|
||||
node.style.right = "auto";
|
||||
node.style.bottom = "auto";
|
||||
|
||||
// Now position the local camera view correctly with respect to the remote
|
||||
// video stream.
|
||||
|
||||
// The top is measured from the top of the element down the screen,
|
||||
// so subtract the height of the video and the separation distance.
|
||||
node.style.top = (localNode.offsetTop - height - LOCAL_REMOTE_SEPARATION) + "px";
|
||||
|
||||
// Match the left-hand sides.
|
||||
node.style.left = localNode.offsetLeft + "px";
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if current room is active.
|
||||
*
|
||||
@ -647,34 +367,29 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var localStreamClasses = React.addons.classSet({
|
||||
local: true,
|
||||
"local-stream": true,
|
||||
"local-stream-audio": this.state.videoMuted
|
||||
});
|
||||
var displayScreenShare = this.state.receivingScreenShare ||
|
||||
this.props.screenSharePosterUrl;
|
||||
|
||||
var remoteStreamClasses = React.addons.classSet({
|
||||
"video_inner": true,
|
||||
"remote": true,
|
||||
"focus-stream": !this.state.receivingScreenShare,
|
||||
"remote-inset-stream": this.state.receivingScreenShare
|
||||
"focus-stream": !displayScreenShare
|
||||
});
|
||||
|
||||
var screenShareStreamClasses = React.addons.classSet({
|
||||
"screen": true,
|
||||
"focus-stream": this.state.receivingScreenShare,
|
||||
hide: !this.state.receivingScreenShare
|
||||
"focus-stream": displayScreenShare
|
||||
});
|
||||
|
||||
var mediaWrapperClasses = React.addons.classSet({
|
||||
"media-wrapper": true,
|
||||
"receiving-screen-share": displayScreenShare,
|
||||
"showing-local-streams": this.state.localSrcVideoObject ||
|
||||
this.props.localPosterUrl
|
||||
});
|
||||
|
||||
// XXX Temporarily showAlways = showRoomName = false for TextChatView
|
||||
// until bug 1168829 is completed.
|
||||
return (
|
||||
<div className="room-conversation-wrapper">
|
||||
<div className="beta-logo" />
|
||||
<sharedViews.TextChatView
|
||||
dispatcher={this.props.dispatcher}
|
||||
showAlways={false}
|
||||
showRoomName={false} />
|
||||
<StandaloneRoomHeader dispatcher={this.props.dispatcher} />
|
||||
<StandaloneRoomInfoArea roomState={this.state.roomState}
|
||||
failureReason={this.state.failureReason}
|
||||
@ -682,50 +397,44 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
isFirefox={this.props.isFirefox}
|
||||
activeRoomStore={this.props.activeRoomStore}
|
||||
roomUsed={this.state.used} />
|
||||
<div className="video-layout-wrapper">
|
||||
<div className="conversation room-conversation">
|
||||
<StandaloneRoomContextView
|
||||
dispatcher={this.props.dispatcher}
|
||||
receivingScreenShare={this.state.receivingScreenShare}
|
||||
roomContextUrls={this.state.roomContextUrls}
|
||||
roomName={this.state.roomName}
|
||||
roomInfoFailure={this.state.roomInfoFailure} />
|
||||
<div className="media nested">
|
||||
<span className="self-view-hidden-message">
|
||||
{mozL10n.get("self_view_hidden_message")}
|
||||
</span>
|
||||
<div className="video_wrapper remote_wrapper">
|
||||
<div className={remoteStreamClasses}>
|
||||
<sharedViews.MediaView displayAvatar={!this.shouldRenderRemoteVideo()}
|
||||
posterUrl={this.props.remotePosterUrl}
|
||||
mediaType="remote"
|
||||
srcVideoObject={this.state.remoteSrcVideoObject} />
|
||||
</div>
|
||||
<div className={screenShareStreamClasses}>
|
||||
<sharedViews.MediaView displayAvatar={false}
|
||||
posterUrl={this.props.screenSharePosterUrl}
|
||||
mediaType="screen-share"
|
||||
srcVideoObject={this.state.screenShareVideoObject} />
|
||||
</div>
|
||||
</div>
|
||||
<div className={localStreamClasses}>
|
||||
<sharedViews.MediaView displayAvatar={this.state.videoMuted}
|
||||
posterUrl={this.props.localPosterUrl}
|
||||
mediaType="local"
|
||||
srcVideoObject={this.state.localSrcVideoObject} />
|
||||
</div>
|
||||
<div className="media-layout">
|
||||
<div className={mediaWrapperClasses}>
|
||||
<span className="self-view-hidden-message">
|
||||
{mozL10n.get("self_view_hidden_message")}
|
||||
</span>
|
||||
<div className={remoteStreamClasses}>
|
||||
<sharedViews.MediaView displayAvatar={!this.shouldRenderRemoteVideo()}
|
||||
posterUrl={this.props.remotePosterUrl}
|
||||
mediaType="remote"
|
||||
srcVideoObject={this.state.remoteSrcVideoObject} />
|
||||
</div>
|
||||
<sharedViews.ConversationToolbar
|
||||
<div className={screenShareStreamClasses}>
|
||||
<sharedViews.MediaView displayAvatar={false}
|
||||
posterUrl={this.props.screenSharePosterUrl}
|
||||
mediaType="screen-share"
|
||||
srcVideoObject={this.state.screenShareVideoObject} />
|
||||
</div>
|
||||
<sharedViews.TextChatView
|
||||
dispatcher={this.props.dispatcher}
|
||||
video={{enabled: !this.state.videoMuted,
|
||||
visible: this._roomIsActive()}}
|
||||
audio={{enabled: !this.state.audioMuted,
|
||||
visible: this._roomIsActive()}}
|
||||
publishStream={this.publishStream}
|
||||
hangup={this.leaveRoom}
|
||||
hangupButtonLabel={mozL10n.get("rooms_leave_button_label")}
|
||||
enableHangup={this._roomIsActive()} />
|
||||
showAlways={true}
|
||||
showRoomName={true} />
|
||||
<div className="local">
|
||||
<sharedViews.MediaView displayAvatar={this.state.videoMuted}
|
||||
posterUrl={this.props.localPosterUrl}
|
||||
mediaType="local"
|
||||
srcVideoObject={this.state.localSrcVideoObject} />
|
||||
</div>
|
||||
</div>
|
||||
<sharedViews.ConversationToolbar
|
||||
dispatcher={this.props.dispatcher}
|
||||
video={{enabled: !this.state.videoMuted,
|
||||
visible: this._roomIsActive()}}
|
||||
audio={{enabled: !this.state.audioMuted,
|
||||
visible: this._roomIsActive()}}
|
||||
publishStream={this.publishStream}
|
||||
hangup={this.leaveRoom}
|
||||
hangupButtonLabel={mozL10n.get("rooms_leave_button_label")}
|
||||
enableHangup={this._roomIsActive()} />
|
||||
</div>
|
||||
<loop.fxOSMarketplaceViews.FxOSHiddenMarketplaceView
|
||||
marketplaceSrc={this.state.marketplaceSrc}
|
||||
@ -737,7 +446,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
});
|
||||
|
||||
return {
|
||||
StandaloneRoomContextView: StandaloneRoomContextView,
|
||||
StandaloneRoomFooter: StandaloneRoomFooter,
|
||||
StandaloneRoomHeader: StandaloneRoomHeader,
|
||||
StandaloneRoomView: StandaloneRoomView
|
||||
|
@ -1094,6 +1094,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
});
|
||||
|
||||
loop.store.StoreMixin.register({
|
||||
activeRoomStore: activeRoomStore,
|
||||
feedbackStore: feedbackStore,
|
||||
// This isn't used in any views, but is saved here to ensure it
|
||||
// is kept alive.
|
||||
|
@ -1094,6 +1094,7 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
});
|
||||
|
||||
loop.store.StoreMixin.register({
|
||||
activeRoomStore: activeRoomStore,
|
||||
feedbackStore: feedbackStore,
|
||||
// This isn't used in any views, but is saved here to ensure it
|
||||
// is kept alive.
|
||||
|
@ -850,6 +850,25 @@ describe("loop.panel", function() {
|
||||
expect(contextContent).to.not.equal(null);
|
||||
});
|
||||
|
||||
it("should cancel the checkbox when a new URL is available", function() {
|
||||
fakeMozLoop.getSelectedTabMetadata = function (callback) {
|
||||
callback({
|
||||
url: "https://www.example.com",
|
||||
description: "fake description",
|
||||
previews: [""]
|
||||
});
|
||||
};
|
||||
|
||||
var view = createTestComponent();
|
||||
|
||||
view.setState({ checked: true });
|
||||
|
||||
// Simulate being visible
|
||||
view.onDocumentVisible();
|
||||
|
||||
expect(view.state.checked).eql(false);
|
||||
});
|
||||
|
||||
it("should show a default favicon when none is available", function() {
|
||||
fakeMozLoop.getSelectedTabMetadata = function (callback) {
|
||||
callback({
|
||||
|
@ -411,6 +411,16 @@ describe("loop.OTSdkDriver", function () {
|
||||
sinon.assert.calledOnce(session.disconnect);
|
||||
});
|
||||
|
||||
it("should dispatch a DataChannelsAvailable action with available = false", function() {
|
||||
driver.disconnectSession();
|
||||
|
||||
sinon.assert.calledOnce(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
});
|
||||
|
||||
it("should destroy the publisher", function() {
|
||||
driver.publisher = publisher;
|
||||
|
||||
@ -1005,7 +1015,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
|
||||
publisher.trigger("streamDestroyed");
|
||||
|
||||
sinon.assert.calledOnce(dispatcher.dispatch);
|
||||
sinon.assert.calledTwice(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.ConnectionStatus({
|
||||
event: "Publisher.streamDestroyed",
|
||||
@ -1015,6 +1025,16 @@ describe("loop.OTSdkDriver", function () {
|
||||
sendStreams: 0
|
||||
}));
|
||||
});
|
||||
|
||||
it("should dispatch a DataChannelsAvailable action", function() {
|
||||
publisher.trigger("streamDestroyed");
|
||||
|
||||
sinon.assert.calledTwice(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
describe("streamDestroyed: session/remote", function() {
|
||||
@ -1054,7 +1074,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
}));
|
||||
});
|
||||
|
||||
it("should not dispatch an action if the videoType is camera", function() {
|
||||
it("should not dispatch a ConnectionStatus action if the videoType is camera", function() {
|
||||
stream.videoType = "camera";
|
||||
|
||||
session.trigger("streamDestroyed", { stream: stream });
|
||||
@ -1062,6 +1082,25 @@ describe("loop.OTSdkDriver", function () {
|
||||
sinon.assert.neverCalledWithMatch(dispatcher.dispatch,
|
||||
sinon.match.hasOwn("name", "receivingScreenShare"));
|
||||
});
|
||||
|
||||
it("should dispatch a DataChannelsAvailable action for videoType = camera", function() {
|
||||
stream.videoType = "camera";
|
||||
|
||||
session.trigger("streamDestroyed", { stream: stream });
|
||||
|
||||
sinon.assert.calledTwice(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
});
|
||||
|
||||
it("should not dispatch a DataChannelsAvailable action for videoType = screen", function() {
|
||||
session.trigger("streamDestroyed", { stream: stream });
|
||||
|
||||
sinon.assert.neverCalledWithMatch(dispatcher.dispatch,
|
||||
sinon.match.hasOwn("name", "dataChannelsAvailable"));
|
||||
});
|
||||
});
|
||||
|
||||
describe("streamPropertyChanged", function() {
|
||||
@ -1297,7 +1336,9 @@ describe("loop.OTSdkDriver", function () {
|
||||
|
||||
sinon.assert.calledOnce(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.DataChannelsAvailable());
|
||||
new sharedActions.DataChannelsAvailable({
|
||||
available: true
|
||||
}));
|
||||
});
|
||||
|
||||
it("should dispatch `ReceivedTextChatMessage` when a text message is received", function() {
|
||||
|
@ -37,19 +37,31 @@ describe("loop.store.TextChatStore", function () {
|
||||
});
|
||||
|
||||
describe("#dataChannelsAvailable", function() {
|
||||
it("should set textChatEnabled to true", function() {
|
||||
store.dataChannelsAvailable();
|
||||
it("should set textChatEnabled to the supplied state", function() {
|
||||
store.dataChannelsAvailable(new sharedActions.DataChannelsAvailable({
|
||||
available: true
|
||||
}));
|
||||
|
||||
expect(store.getStoreState("textChatEnabled")).eql(true);
|
||||
});
|
||||
|
||||
it("should dispatch a LoopChatEnabled event", function() {
|
||||
store.dataChannelsAvailable();
|
||||
store.dataChannelsAvailable(new sharedActions.DataChannelsAvailable({
|
||||
available: true
|
||||
}));
|
||||
|
||||
sinon.assert.calledOnce(window.dispatchEvent);
|
||||
sinon.assert.calledWithExactly(window.dispatchEvent,
|
||||
new CustomEvent("LoopChatEnabled"));
|
||||
});
|
||||
|
||||
it("should not dispatch a LoopChatEnabled event if available is false", function() {
|
||||
store.dataChannelsAvailable(new sharedActions.DataChannelsAvailable({
|
||||
available: false
|
||||
}));
|
||||
|
||||
sinon.assert.notCalled(window.dispatchEvent);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#receivedTextChatMessage", function() {
|
||||
@ -133,8 +145,6 @@ describe("loop.store.TextChatStore", function () {
|
||||
|
||||
describe("#updateRoomInfo", function() {
|
||||
it("should add the room name to the list", function() {
|
||||
sandbox.stub(navigator.mozL10n, "get").returns("Let's really share!");
|
||||
|
||||
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
|
||||
roomName: "Let's share!",
|
||||
roomOwner: "Mark",
|
||||
@ -144,14 +154,12 @@ describe("loop.store.TextChatStore", function () {
|
||||
expect(store.getStoreState("messageList")).eql([{
|
||||
type: CHAT_MESSAGE_TYPES.SPECIAL,
|
||||
contentType: CHAT_CONTENT_TYPES.ROOM_NAME,
|
||||
message: "Let's really share!",
|
||||
message: "Let's share!",
|
||||
extraData: undefined
|
||||
}]);
|
||||
});
|
||||
|
||||
it("should add the context to the list", function() {
|
||||
sandbox.stub(navigator.mozL10n, "get").returns("Let's really share!");
|
||||
|
||||
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
|
||||
roomName: "Let's share!",
|
||||
roomOwner: "Mark",
|
||||
@ -167,7 +175,7 @@ describe("loop.store.TextChatStore", function () {
|
||||
{
|
||||
type: CHAT_MESSAGE_TYPES.SPECIAL,
|
||||
contentType: CHAT_CONTENT_TYPES.ROOM_NAME,
|
||||
message: "Let's really share!",
|
||||
message: "Let's share!",
|
||||
extraData: undefined
|
||||
}, {
|
||||
type: CHAT_MESSAGE_TYPES.SPECIAL,
|
||||
@ -182,8 +190,6 @@ describe("loop.store.TextChatStore", function () {
|
||||
});
|
||||
|
||||
it("should not dispatch a LoopChatMessageAppended event", function() {
|
||||
sandbox.stub(navigator.mozL10n, "get").returns("Let's really share!");
|
||||
|
||||
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
|
||||
roomName: "Let's share!",
|
||||
roomOwner: "Mark",
|
||||
|
@ -174,5 +174,18 @@ describe("loop.shared.views.TextChatView", function () {
|
||||
message: "Hello!"
|
||||
}));
|
||||
});
|
||||
|
||||
it("should not dispatch SendTextChatMessage when the message is empty", function() {
|
||||
view = mountTestComponent();
|
||||
|
||||
var entryNode = view.getDOMNode().querySelector(".text-chat-box > form > input");
|
||||
|
||||
TestUtils.Simulate.keyDown(entryNode, {
|
||||
key: "Enter",
|
||||
which: 13
|
||||
});
|
||||
|
||||
sinon.assert.notCalled(dispatcher.dispatch);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -765,6 +765,26 @@ describe("loop.shared.views", function() {
|
||||
expect(node.classList.contains("disabled")).to.eql(true);
|
||||
expect(node.hasAttribute("disabled")).to.eql(true);
|
||||
});
|
||||
|
||||
it("should render the checkbox as checked when the prop is set", function() {
|
||||
view = mountTestComponent({
|
||||
checked: true
|
||||
});
|
||||
|
||||
var checkbox = view.getDOMNode().querySelector(".checkbox");
|
||||
expect(checkbox.classList.contains("checked")).eql(true);
|
||||
});
|
||||
|
||||
it("should alter the render state when the props are changed", function() {
|
||||
view = mountTestComponent({
|
||||
checked: true
|
||||
});
|
||||
|
||||
view.setProps({checked: false});
|
||||
|
||||
var checkbox = view.getDOMNode().querySelector(".checkbox");
|
||||
expect(checkbox.classList.contains("checked")).eql(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#_handleClick", function() {
|
||||
|
@ -31,6 +31,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||
feedbackClient: {}
|
||||
});
|
||||
loop.store.StoreMixin.register({
|
||||
activeRoomStore: activeRoomStore,
|
||||
feedbackStore: feedbackStore,
|
||||
textChatStore: textChatStore
|
||||
});
|
||||
@ -45,126 +46,6 @@ describe("loop.standaloneRoomViews", function() {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
describe("StandaloneRoomContextView", function() {
|
||||
beforeEach(function() {
|
||||
sandbox.stub(navigator.mozL10n, "get").returnsArg(0);
|
||||
});
|
||||
|
||||
function mountTestComponent(extraProps) {
|
||||
var props = _.extend({
|
||||
dispatcher: dispatcher,
|
||||
receivingScreenShare: false
|
||||
}, extraProps);
|
||||
return TestUtils.renderIntoDocument(
|
||||
React.createElement(
|
||||
loop.standaloneRoomViews.StandaloneRoomContextView, props));
|
||||
}
|
||||
|
||||
it("should display the room name if no failures are known", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mike's room",
|
||||
receivingScreenShare: false
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().textContent).eql("Mike's room");
|
||||
});
|
||||
|
||||
it("should log an unsupported browser message if crypto is unsupported", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mark's room",
|
||||
roomInfoFailure: ROOM_INFO_FAILURES.WEB_CRYPTO_UNSUPPORTED
|
||||
});
|
||||
|
||||
sinon.assert.called(console.error);
|
||||
sinon.assert.calledWithMatch(console.error, sinon.match("unsupported"));
|
||||
});
|
||||
|
||||
it("should display a general error message for any other failure", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mark's room",
|
||||
roomInfoFailure: ROOM_INFO_FAILURES.NO_DATA
|
||||
});
|
||||
|
||||
sinon.assert.called(console.error);
|
||||
sinon.assert.calledWithMatch(console.error, sinon.match("not_available"));
|
||||
});
|
||||
|
||||
it("should display context information if a url is supplied", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mike's room",
|
||||
roomContextUrls: [{
|
||||
description: "Mark's super page",
|
||||
location: "http://invalid.com",
|
||||
thumbnail: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||
}]
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".standalone-context-url")).not.eql(null);
|
||||
});
|
||||
|
||||
it("should format the url for display", function() {
|
||||
sandbox.stub(sharedUtils, "formatURL").returns({
|
||||
location: "location",
|
||||
hostname: "hostname"
|
||||
});
|
||||
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mike's room",
|
||||
roomContextUrls: [{
|
||||
description: "Mark's super page",
|
||||
location: "http://invalid.com",
|
||||
thumbnail: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||
}]
|
||||
});
|
||||
|
||||
expect(view.getDOMNode()
|
||||
.querySelector(".standalone-context-url-description-wrapper > a").textContent)
|
||||
.eql("hostname");
|
||||
});
|
||||
|
||||
it("should not display context information if no urls are supplied", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mike's room"
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".standalone-context-url")).eql(null);
|
||||
});
|
||||
|
||||
it("should dispatch a RecordClick action when the link is clicked", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mark's room",
|
||||
roomContextUrls: [{
|
||||
description: "Mark's super page",
|
||||
location: "http://invalid.com",
|
||||
thumbnail: "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||
}]
|
||||
});
|
||||
|
||||
TestUtils.Simulate.click(view.getDOMNode()
|
||||
.querySelector(".standalone-context-url-description-wrapper > a"));
|
||||
|
||||
sinon.assert.calledOnce(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.RecordClick({
|
||||
linkInfo: "Shared URL"
|
||||
}));
|
||||
});
|
||||
|
||||
it("should display the default favicon when no thumbnail is available", function() {
|
||||
var view = mountTestComponent({
|
||||
roomName: "Mike's room",
|
||||
roomContextUrls: [{
|
||||
description: "Mark's super page",
|
||||
location: "http://invalid.com",
|
||||
thumbnail: ""
|
||||
}]
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".standalone-context-url > img").src)
|
||||
.to.match(/shared\/img\/icons-16x16.svg#globe$/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("StandaloneRoomHeader", function() {
|
||||
function mountTestComponent() {
|
||||
return TestUtils.renderIntoDocument(
|
||||
@ -224,43 +105,6 @@ describe("loop.standaloneRoomViews", function() {
|
||||
|
||||
expectActionDispatched(view);
|
||||
});
|
||||
|
||||
it("should updateVideoContainer when the JOINED state is entered", function() {
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.READY});
|
||||
|
||||
var view = mountTestComponent();
|
||||
|
||||
sandbox.stub(view, "updateVideoContainer");
|
||||
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.JOINED});
|
||||
|
||||
sinon.assert.calledOnce(view.updateVideoContainer);
|
||||
});
|
||||
|
||||
it("should updateVideoContainer when the JOINED state is re-entered", function() {
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.ENDED});
|
||||
|
||||
var view = mountTestComponent();
|
||||
|
||||
sandbox.stub(view, "updateVideoContainer");
|
||||
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.JOINED});
|
||||
|
||||
sinon.assert.calledOnce(view.updateVideoContainer);
|
||||
});
|
||||
|
||||
it("should reset the video dimensions cache when the gather state is entered", function() {
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.SESSION_CONNECTED});
|
||||
|
||||
var view = mountTestComponent();
|
||||
|
||||
activeRoomStore.setStoreState({roomState: ROOM_STATES.GATHER});
|
||||
|
||||
expect(view._videoDimensionsCache).eql({
|
||||
local: {},
|
||||
remote: {}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("#publishStream", function() {
|
||||
@ -297,252 +141,6 @@ describe("loop.standaloneRoomViews", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Local Stream Size Position", function() {
|
||||
var view, localElement;
|
||||
|
||||
beforeEach(function() {
|
||||
sandbox.stub(window, "matchMedia").returns({
|
||||
matches: false
|
||||
});
|
||||
activeRoomStore.setStoreState({
|
||||
remoteSrcVideoObject: {},
|
||||
remoteVideoEnabled: true
|
||||
});
|
||||
view = mountTestComponent();
|
||||
localElement = view._getElement(".local");
|
||||
});
|
||||
|
||||
it("should be a quarter of the width of the main stream", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 640,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("160px");
|
||||
expect(localElement.style.height).eql("120px");
|
||||
});
|
||||
|
||||
it("should be a quarter of the width of the remote view element when there is no stream", function() {
|
||||
activeRoomStore.setStoreState({
|
||||
remoteSrcVideoObject: null,
|
||||
remoteVideoEnabled: false
|
||||
});
|
||||
|
||||
sandbox.stub(view, "getDOMNode").returns({
|
||||
querySelector: function(selector) {
|
||||
if (selector === ".local") {
|
||||
return localElement;
|
||||
}
|
||||
|
||||
return {
|
||||
offsetWidth: 640,
|
||||
offsetLeft: 0
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("160px");
|
||||
expect(localElement.style.height).eql("120px");
|
||||
});
|
||||
|
||||
it("should be a quarter of the width reduced for aspect ratio", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 640,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 0.75,
|
||||
height: 1
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("120px");
|
||||
expect(localElement.style.height).eql("160px");
|
||||
});
|
||||
|
||||
it("should ensure the height is a minimum of 48px", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 180,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("64px");
|
||||
expect(localElement.style.height).eql("48px");
|
||||
});
|
||||
|
||||
it("should ensure the width is a minimum of 48px", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 180,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 0.75,
|
||||
height: 1
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("48px");
|
||||
expect(localElement.style.height).eql("64px");
|
||||
});
|
||||
|
||||
it("should position the stream to overlap the main stream by a quarter", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 640,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("160px");
|
||||
expect(localElement.style.left).eql("600px");
|
||||
});
|
||||
|
||||
it("should position the stream to overlap the remote view element when there is no stream", function() {
|
||||
activeRoomStore.setStoreState({
|
||||
remoteSrcVideoObject: null,
|
||||
remoteVideoEnabled: false
|
||||
});
|
||||
|
||||
sandbox.stub(view, "getDOMNode").returns({
|
||||
querySelector: function(selector) {
|
||||
if (selector === ".local") {
|
||||
return localElement;
|
||||
}
|
||||
|
||||
return {
|
||||
offsetWidth: 640,
|
||||
offsetLeft: 0
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("160px");
|
||||
expect(localElement.style.left).eql("600px");
|
||||
});
|
||||
|
||||
it("should position the stream to overlap the main stream by a quarter when the aspect ratio is vertical", function() {
|
||||
sandbox.stub(view, "getRemoteVideoDimensions").returns({
|
||||
streamWidth: 640,
|
||||
offsetX: 0
|
||||
});
|
||||
|
||||
view.updateLocalCameraPosition({
|
||||
width: 0.75,
|
||||
height: 1
|
||||
});
|
||||
|
||||
expect(localElement.style.width).eql("120px");
|
||||
expect(localElement.style.left).eql("610px");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Remote Stream Size Position", function() {
|
||||
var view, localElement, remoteElement;
|
||||
|
||||
beforeEach(function() {
|
||||
sandbox.stub(window, "matchMedia").returns({
|
||||
matches: false
|
||||
});
|
||||
view = mountTestComponent();
|
||||
|
||||
localElement = {
|
||||
style: {}
|
||||
};
|
||||
remoteElement = {
|
||||
style: {},
|
||||
removeAttribute: sinon.spy()
|
||||
};
|
||||
|
||||
sandbox.stub(view, "_getElement", function(className) {
|
||||
return className === ".local" ? localElement : remoteElement;
|
||||
});
|
||||
|
||||
view.setState({"receivingScreenShare": true});
|
||||
});
|
||||
|
||||
it("should do nothing if not receiving screenshare", function() {
|
||||
view.setState({"receivingScreenShare": false});
|
||||
remoteElement.style.width = "10px";
|
||||
|
||||
view.updateRemoteCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(remoteElement.style.width).eql("10px");
|
||||
});
|
||||
|
||||
it("should be the same width as the local video", function() {
|
||||
localElement.offsetWidth = 100;
|
||||
|
||||
view.updateRemoteCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(remoteElement.style.width).eql("100px");
|
||||
});
|
||||
|
||||
it("should be the same left edge as the local video", function() {
|
||||
localElement.offsetLeft = 50;
|
||||
|
||||
view.updateRemoteCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(remoteElement.style.left).eql("50px");
|
||||
});
|
||||
|
||||
it("should have a height determined by the aspect ratio", function() {
|
||||
localElement.offsetWidth = 100;
|
||||
|
||||
view.updateRemoteCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
expect(remoteElement.style.height).eql("75px");
|
||||
});
|
||||
|
||||
it("should have the top be set such that the bottom is 10px above the local video", function() {
|
||||
localElement.offsetWidth = 100;
|
||||
localElement.offsetTop = 200;
|
||||
|
||||
view.updateRemoteCameraPosition({
|
||||
width: 1,
|
||||
height: 0.75
|
||||
});
|
||||
|
||||
// 200 (top) - 75 (height) - 10 (spacing) = 115
|
||||
expect(remoteElement.style.top).eql("115px");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("#render", function() {
|
||||
var view;
|
||||
|
||||
@ -827,14 +425,14 @@ describe("loop.standaloneRoomViews", function() {
|
||||
});
|
||||
|
||||
describe("Mute", function() {
|
||||
it("should render local media as audio-only if video is muted",
|
||||
it("should render a local avatar if video is muted",
|
||||
function() {
|
||||
activeRoomStore.setStoreState({
|
||||
roomState: ROOM_STATES.SESSION_CONNECTED,
|
||||
videoMuted: true
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".local-stream-audio"))
|
||||
expect(view.getDOMNode().querySelector(".local .avatar"))
|
||||
.not.eql(null);
|
||||
});
|
||||
|
||||
|
@ -270,6 +270,7 @@
|
||||
}));
|
||||
|
||||
loop.store.StoreMixin.register({
|
||||
activeRoomStore: activeRoomStore,
|
||||
conversationStore: conversationStore,
|
||||
feedbackStore: feedbackStore,
|
||||
textChatStore: textChatStore
|
||||
@ -971,6 +972,21 @@
|
||||
localPosterUrl: "sample-img/video-screen-local.png",
|
||||
remotePosterUrl: "sample-img/video-screen-remote.png"})
|
||||
)
|
||||
),
|
||||
|
||||
React.createElement(FramedExample, {width: 600, height: 480,
|
||||
onContentsRendered: updatingSharingRoomStore.forcedUpdate,
|
||||
summary: "Standalone room convo (has-participants, receivingScreenShare, 600x480)"},
|
||||
React.createElement("div", {className: "standalone", cssClass: "standalone"},
|
||||
React.createElement(StandaloneRoomView, {
|
||||
dispatcher: dispatcher,
|
||||
activeRoomStore: updatingSharingRoomStore,
|
||||
roomState: ROOM_STATES.HAS_PARTICIPANTS,
|
||||
isFirefox: true,
|
||||
localPosterUrl: "sample-img/video-screen-local.png",
|
||||
remotePosterUrl: "sample-img/video-screen-remote.png",
|
||||
screenSharePosterUrl: "sample-img/video-screen-terminal.png"})
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
|
@ -270,6 +270,7 @@
|
||||
}));
|
||||
|
||||
loop.store.StoreMixin.register({
|
||||
activeRoomStore: activeRoomStore,
|
||||
conversationStore: conversationStore,
|
||||
feedbackStore: feedbackStore,
|
||||
textChatStore: textChatStore
|
||||
@ -972,6 +973,21 @@
|
||||
remotePosterUrl="sample-img/video-screen-remote.png" />
|
||||
</div>
|
||||
</FramedExample>
|
||||
|
||||
<FramedExample width={600} height={480}
|
||||
onContentsRendered={updatingSharingRoomStore.forcedUpdate}
|
||||
summary="Standalone room convo (has-participants, receivingScreenShare, 600x480)">
|
||||
<div className="standalone" cssClass="standalone">
|
||||
<StandaloneRoomView
|
||||
dispatcher={dispatcher}
|
||||
activeRoomStore={updatingSharingRoomStore}
|
||||
roomState={ROOM_STATES.HAS_PARTICIPANTS}
|
||||
isFirefox={true}
|
||||
localPosterUrl="sample-img/video-screen-local.png"
|
||||
remotePosterUrl="sample-img/video-screen-remote.png"
|
||||
screenSharePosterUrl="sample-img/video-screen-terminal.png" />
|
||||
</div>
|
||||
</FramedExample>
|
||||
</Section>
|
||||
|
||||
<Section name="TextChatView (standalone)">
|
||||
|
@ -14,6 +14,7 @@ let state = {windows:[{tabs:[
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
requestLongerTimeout(2);
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref("browser.sessionstore.restore_hidden_tabs");
|
||||
|
@ -71,6 +71,7 @@ support-files =
|
||||
[browser_perf-loading-01.js]
|
||||
[browser_perf-loading-02.js]
|
||||
[browser_perf-marker-details-01.js]
|
||||
skip-if = os == 'linux' # Bug 1172120
|
||||
[browser_perf-options-01.js]
|
||||
[browser_perf-options-02.js]
|
||||
[browser_perf-options-03.js]
|
||||
|
@ -31,10 +31,10 @@ body {
|
||||
|
||||
#pseudo-class-panel {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
overflow-y: hidden;
|
||||
max-height: 24px;
|
||||
justify-content: space-around;
|
||||
transition-property: max-height;
|
||||
transition-duration: 150ms;
|
||||
transition-timing-function: ease;
|
||||
@ -46,6 +46,7 @@ body {
|
||||
|
||||
#pseudo-class-panel > label {
|
||||
-moz-user-select: none;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.ruleview {
|
||||
|
@ -16,6 +16,7 @@ let PAGE_CONTENT = [
|
||||
'<div id="testid" class="testclass">Styled Node</div>',
|
||||
'<span class="testclass2">This is a span</span>',
|
||||
'<span class="class1 class2">Multiple classes</span>',
|
||||
'<span class="class3 class4">Multiple classes</span>',
|
||||
'<p>Empty<p>',
|
||||
'<h1 class="asd@@@@a!!!!:::@asd">Invalid characters in class</h1>',
|
||||
'<h2 id="asd@@@a!!2a">Invalid characters in id</h2>'
|
||||
@ -25,6 +26,7 @@ const TEST_DATA = [
|
||||
{ node: "#testid", expected: "#testid" },
|
||||
{ node: ".testclass2", expected: ".testclass2" },
|
||||
{ node: ".class1.class2", expected: ".class1.class2" },
|
||||
{ node: ".class3.class4", expected: ".class3.class4" },
|
||||
{ node: "p", expected: "p" },
|
||||
{ node: "h1", expected: ".asd\\@\\@\\@\\@a\\!\\!\\!\\!\\:\\:\\:\\@asd" },
|
||||
{ node: "h2", expected: "#asd\\@\\@\\@a\\!\\!2a" }
|
||||
|
@ -22,7 +22,12 @@ let PAGE_CONTENT = [
|
||||
'<div id="testid3">B</div>'
|
||||
].join("\n");
|
||||
|
||||
const PSEUDO_PREF = "devtools.inspector.show_pseudo_elements";
|
||||
|
||||
add_task(function*() {
|
||||
// Expand the pseudo-elements section by default.
|
||||
Services.prefs.setBoolPref(PSEUDO_PREF, true);
|
||||
|
||||
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(PAGE_CONTENT));
|
||||
let {inspector, view} = yield openRuleView();
|
||||
|
||||
@ -41,6 +46,9 @@ add_task(function*() {
|
||||
info("Selecting the modified element");
|
||||
yield selectNode(".testclass2", inspector);
|
||||
yield checkModifiedElement(view, ".testclass2::first-letter");
|
||||
|
||||
// Reset the pseudo-elements section pref to its default value.
|
||||
Services.prefs.clearUserPref(PSEUDO_PREF);
|
||||
});
|
||||
|
||||
function* testEditSelector(view, name) {
|
||||
|
@ -7,10 +7,13 @@
|
||||
// Test that pseudoelements are displayed correctly in the rule view
|
||||
|
||||
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
|
||||
const PSEUDO_PREF = "devtools.inspector.show_pseudo_elements";
|
||||
|
||||
add_task(function*() {
|
||||
Services.prefs.setBoolPref(PSEUDO_PREF, true);
|
||||
|
||||
yield addTab(TEST_URI);
|
||||
let {toolbox, inspector, view} = yield openRuleView();
|
||||
let {inspector, view} = yield openRuleView();
|
||||
|
||||
yield testTopLeft(inspector, view);
|
||||
yield testTopRight(inspector, view);
|
||||
@ -18,15 +21,13 @@ add_task(function*() {
|
||||
yield testBottomLeft(inspector, view);
|
||||
yield testParagraph(inspector, view);
|
||||
yield testBody(inspector, view);
|
||||
|
||||
Services.prefs.clearUserPref(PSEUDO_PREF);
|
||||
});
|
||||
|
||||
function* testTopLeft(inspector, view) {
|
||||
let selector = "#topleft";
|
||||
let {
|
||||
rules,
|
||||
element,
|
||||
elementStyle
|
||||
} = yield assertPseudoElementRulesNumbers(selector, inspector, view, {
|
||||
let {rules} = yield assertPseudoElementRulesNumbers(selector, inspector, view, {
|
||||
elementRulesNb: 4,
|
||||
firstLineRulesNb: 2,
|
||||
firstLetterRulesNb: 1,
|
||||
@ -35,83 +36,84 @@ function* testTopLeft(inspector, view) {
|
||||
|
||||
let gutters = assertGutters(view);
|
||||
|
||||
// Make sure that clicking on the twisty hides pseudo elements
|
||||
info("Make sure that clicking on the twisty hides pseudo elements");
|
||||
let expander = gutters[0].querySelector(".ruleview-expander");
|
||||
ok (view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements are expanded");
|
||||
expander.click();
|
||||
ok (!view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements are collapsed by twisty");
|
||||
expander.click();
|
||||
ok (view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements are expanded again");
|
||||
ok(view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements are expanded");
|
||||
|
||||
// Make sure that dblclicking on the header container also toggles the pseudo elements
|
||||
EventUtils.synthesizeMouseAtCenter(gutters[0], {clickCount: 2}, inspector.sidebar.getWindowForTab("ruleview"));
|
||||
ok (!view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements are collapsed by dblclicking");
|
||||
expander.click();
|
||||
ok(!view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements are collapsed by twisty");
|
||||
|
||||
let defaultView = element.ownerDocument.defaultView;
|
||||
expander.click();
|
||||
ok(view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements are expanded again");
|
||||
|
||||
info("Make sure that dblclicking on the header container also toggles " +
|
||||
"the pseudo elements");
|
||||
EventUtils.synthesizeMouseAtCenter(gutters[0], {clickCount: 2},
|
||||
view.doc.defaultView);
|
||||
ok(!view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements are collapsed by dblclicking");
|
||||
|
||||
let elementRule = rules.elementRules[0];
|
||||
let elementRuleView = getRuleViewRuleEditor(view, 3);
|
||||
|
||||
let elementFirstLineRule = rules.firstLineRules[0];
|
||||
let elementFirstLineRuleView = [].filter.call(view.element.children[1].children, (e) => {
|
||||
let elementFirstLineRuleView = [...view.element.children[1].children].filter(e => {
|
||||
return e._ruleEditor && e._ruleEditor.rule === elementFirstLineRule;
|
||||
})[0]._ruleEditor;
|
||||
|
||||
is
|
||||
(
|
||||
convertTextPropsToString(elementFirstLineRule.textProps),
|
||||
"color: orange",
|
||||
"TopLeft firstLine properties are correct"
|
||||
);
|
||||
is(convertTextPropsToString(elementFirstLineRule.textProps),
|
||||
"color: orange",
|
||||
"TopLeft firstLine properties are correct");
|
||||
|
||||
let firstProp = elementFirstLineRuleView.addProperty("background-color", "rgb(0, 255, 0)", "");
|
||||
let secondProp = elementFirstLineRuleView.addProperty("font-style", "italic", "");
|
||||
|
||||
is (firstProp, elementFirstLineRule.textProps[elementFirstLineRule.textProps.length - 2],
|
||||
"First added property is on back of array");
|
||||
is (secondProp, elementFirstLineRule.textProps[elementFirstLineRule.textProps.length - 1],
|
||||
"Second added property is on back of array");
|
||||
is(firstProp,
|
||||
elementFirstLineRule.textProps[elementFirstLineRule.textProps.length - 2],
|
||||
"First added property is on back of array");
|
||||
is(secondProp,
|
||||
elementFirstLineRule.textProps[elementFirstLineRule.textProps.length - 1],
|
||||
"Second added property is on back of array");
|
||||
|
||||
yield elementFirstLineRule._applyingModifications;
|
||||
|
||||
is((yield getComputedStyleProperty(selector, ":first-line", "background-color")),
|
||||
"rgb(0, 255, 0)", "Added property should have been used.");
|
||||
"rgb(0, 255, 0)", "Added property should have been used.");
|
||||
is((yield getComputedStyleProperty(selector, ":first-line", "font-style")),
|
||||
"italic", "Added property should have been used.");
|
||||
"italic", "Added property should have been used.");
|
||||
is((yield getComputedStyleProperty(selector, null, "text-decoration")),
|
||||
"none", "Added property should not apply to element");
|
||||
"none", "Added property should not apply to element");
|
||||
|
||||
firstProp.setEnabled(false);
|
||||
yield elementFirstLineRule._applyingModifications;
|
||||
|
||||
is((yield getComputedStyleProperty(selector, ":first-line", "background-color")),
|
||||
"rgb(255, 0, 0)", "Disabled property should now have been used.");
|
||||
"rgb(255, 0, 0)", "Disabled property should now have been used.");
|
||||
is((yield getComputedStyleProperty(selector, null, "background-color")),
|
||||
"rgb(221, 221, 221)", "Added property should not apply to element");
|
||||
"rgb(221, 221, 221)", "Added property should not apply to element");
|
||||
|
||||
firstProp.setEnabled(true);
|
||||
yield elementFirstLineRule._applyingModifications;
|
||||
|
||||
is((yield getComputedStyleProperty(selector, ":first-line", "background-color")),
|
||||
"rgb(0, 255, 0)", "Added property should have been used.");
|
||||
"rgb(0, 255, 0)", "Added property should have been used.");
|
||||
is((yield getComputedStyleProperty(selector, null, "text-decoration")),
|
||||
"none", "Added property should not apply to element");
|
||||
"none", "Added property should not apply to element");
|
||||
|
||||
firstProp = elementRuleView.addProperty("background-color", "rgb(0, 0, 255)", "");
|
||||
yield elementRule._applyingModifications;
|
||||
|
||||
is((yield getComputedStyleProperty(selector, null, "background-color")),
|
||||
"rgb(0, 0, 255)", "Added property should have been used.");
|
||||
"rgb(0, 0, 255)", "Added property should have been used.");
|
||||
is((yield getComputedStyleProperty(selector, ":first-line", "background-color")),
|
||||
"rgb(0, 255, 0)", "Added prop does not apply to pseudo");
|
||||
"rgb(0, 255, 0)", "Added prop does not apply to pseudo");
|
||||
}
|
||||
|
||||
function* testTopRight(inspector, view) {
|
||||
let {
|
||||
rules,
|
||||
element,
|
||||
elementStyle
|
||||
} = yield assertPseudoElementRulesNumbers("#topright", inspector, view, {
|
||||
yield assertPseudoElementRulesNumbers("#topright", inspector, view, {
|
||||
elementRulesNb: 4,
|
||||
firstLineRulesNb: 1,
|
||||
firstLetterRulesNb: 1,
|
||||
@ -121,10 +123,13 @@ function* testTopRight(inspector, view) {
|
||||
let gutters = assertGutters(view);
|
||||
|
||||
let expander = gutters[0].querySelector(".ruleview-expander");
|
||||
ok (!view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements remain collapsed after switching element");
|
||||
ok(!view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements remain collapsed after switching element");
|
||||
|
||||
expander.scrollIntoView();
|
||||
expander.click();
|
||||
ok (view.element.firstChild.classList.contains("show-expandable-container"), "Pseudo Elements are shown again after clicking twisty");
|
||||
ok(view.element.firstChild.classList.contains("show-expandable-container"),
|
||||
"Pseudo Elements are shown again after clicking twisty");
|
||||
}
|
||||
|
||||
function* testBottomRight(inspector, view) {
|
||||
@ -146,61 +151,36 @@ function* testBottomLeft(inspector, view) {
|
||||
}
|
||||
|
||||
function* testParagraph(inspector, view) {
|
||||
let {
|
||||
rules,
|
||||
element,
|
||||
elementStyle
|
||||
} = yield assertPseudoElementRulesNumbers("#bottomleft p", inspector, view, {
|
||||
let {rules} = yield assertPseudoElementRulesNumbers("#bottomleft p", inspector, view, {
|
||||
elementRulesNb: 3,
|
||||
firstLineRulesNb: 1,
|
||||
firstLetterRulesNb: 1,
|
||||
selectionRulesNb: 1
|
||||
});
|
||||
|
||||
let gutters = assertGutters(view);
|
||||
assertGutters(view);
|
||||
|
||||
let elementFirstLineRule = rules.firstLineRules[0];
|
||||
let elementFirstLineRuleView = [].filter.call(view.element.children[1].children, (e) => {
|
||||
return e._ruleEditor && e._ruleEditor.rule === elementFirstLineRule;
|
||||
})[0]._ruleEditor;
|
||||
|
||||
is
|
||||
(
|
||||
convertTextPropsToString(elementFirstLineRule.textProps),
|
||||
"background: blue none repeat scroll 0% 0%",
|
||||
"Paragraph first-line properties are correct"
|
||||
);
|
||||
is(convertTextPropsToString(elementFirstLineRule.textProps),
|
||||
"background: blue none repeat scroll 0% 0%",
|
||||
"Paragraph first-line properties are correct");
|
||||
|
||||
let elementFirstLetterRule = rules.firstLetterRules[0];
|
||||
let elementFirstLetterRuleView = [].filter.call(view.element.children[1].children, (e) => {
|
||||
return e._ruleEditor && e._ruleEditor.rule === elementFirstLetterRule;
|
||||
})[0]._ruleEditor;
|
||||
|
||||
is
|
||||
(
|
||||
convertTextPropsToString(elementFirstLetterRule.textProps),
|
||||
"color: red; font-size: 130%",
|
||||
"Paragraph first-letter properties are correct"
|
||||
);
|
||||
is(convertTextPropsToString(elementFirstLetterRule.textProps),
|
||||
"color: red; font-size: 130%",
|
||||
"Paragraph first-letter properties are correct");
|
||||
|
||||
let elementSelectionRule = rules.selectionRules[0];
|
||||
let elementSelectionRuleView = [].filter.call(view.element.children[1].children, (e) => {
|
||||
return e._ruleEditor && e._ruleEditor.rule === elementSelectionRule;
|
||||
})[0]._ruleEditor;
|
||||
|
||||
is
|
||||
(
|
||||
convertTextPropsToString(elementSelectionRule.textProps),
|
||||
"color: white; background: black none repeat scroll 0% 0%",
|
||||
"Paragraph first-letter properties are correct"
|
||||
);
|
||||
is(convertTextPropsToString(elementSelectionRule.textProps),
|
||||
"color: white; background: black none repeat scroll 0% 0%",
|
||||
"Paragraph first-letter properties are correct");
|
||||
}
|
||||
|
||||
function* testBody(inspector, view) {
|
||||
let {element, elementStyle} = yield testNode("body", inspector, view);
|
||||
yield testNode("body", inspector, view);
|
||||
|
||||
let gutters = view.element.querySelectorAll(".theme-gutter");
|
||||
is (gutters.length, 0, "There are no gutter headings");
|
||||
let gutters = getGutters(view);
|
||||
is(gutters.length, 0, "There are no gutter headings");
|
||||
}
|
||||
|
||||
function convertTextPropsToString(textProps) {
|
||||
@ -224,24 +204,33 @@ function* assertPseudoElementRulesNumbers(selector, inspector, view, ruleNbs) {
|
||||
selectionRules: elementStyle.rules.filter(rule => rule.pseudoElement === ":-moz-selection")
|
||||
};
|
||||
|
||||
is(rules.elementRules.length, ruleNbs.elementRulesNb, selector +
|
||||
" has the correct number of non pseudo element rules");
|
||||
is(rules.firstLineRules.length, ruleNbs.firstLineRulesNb, selector +
|
||||
" has the correct number of :first-line rules");
|
||||
is(rules.firstLetterRules.length, ruleNbs.firstLetterRulesNb, selector +
|
||||
" has the correct number of :first-letter rules");
|
||||
is(rules.selectionRules.length, ruleNbs.selectionRulesNb, selector +
|
||||
" has the correct number of :selection rules");
|
||||
is(rules.elementRules.length, ruleNbs.elementRulesNb,
|
||||
selector + " has the correct number of non pseudo element rules");
|
||||
is(rules.firstLineRules.length, ruleNbs.firstLineRulesNb,
|
||||
selector + " has the correct number of :first-line rules");
|
||||
is(rules.firstLetterRules.length, ruleNbs.firstLetterRulesNb,
|
||||
selector + " has the correct number of :first-letter rules");
|
||||
is(rules.selectionRules.length, ruleNbs.selectionRulesNb,
|
||||
selector + " has the correct number of :selection rules");
|
||||
|
||||
return {rules: rules, element: element, elementStyle: elementStyle};
|
||||
return {rules, element, elementStyle};
|
||||
}
|
||||
|
||||
function getGutters(view) {
|
||||
return view.element.querySelectorAll(".theme-gutter");
|
||||
}
|
||||
|
||||
function assertGutters(view) {
|
||||
let gutters = view.element.querySelectorAll(".theme-gutter");
|
||||
is (gutters.length, 3, "There are 3 gutter headings");
|
||||
is (gutters[0].textContent, "Pseudo-elements", "Gutter heading is correct");
|
||||
is (gutters[1].textContent, "This Element", "Gutter heading is correct");
|
||||
is (gutters[2].textContent, "Inherited from body", "Gutter heading is correct");
|
||||
let gutters = getGutters(view);
|
||||
|
||||
is(gutters.length, 3,
|
||||
"There are 3 gutter headings");
|
||||
is(gutters[0].textContent, "Pseudo-elements",
|
||||
"Gutter heading is correct");
|
||||
is(gutters[1].textContent, "This Element",
|
||||
"Gutter heading is correct");
|
||||
is(gutters[2].textContent, "Inherited from body",
|
||||
"Gutter heading is correct");
|
||||
|
||||
return gutters;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.1.165
|
||||
Current extension version is: 1.1.215
|
||||
|
@ -161,7 +161,8 @@ function createNewChannel(uri, node, principal) {
|
||||
uri: uri,
|
||||
loadingNode: node,
|
||||
loadingPrincipal: principal,
|
||||
contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER});
|
||||
contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER,
|
||||
});
|
||||
}
|
||||
|
||||
function asyncFetchChannel(channel, callback) {
|
||||
|
@ -183,7 +183,8 @@ let PdfjsChromeUtils = {
|
||||
_findbarFromMessage: function(aMsg) {
|
||||
let browser = aMsg.target;
|
||||
let tabbrowser = browser.getTabBrowser();
|
||||
let tab = tabbrowser.getTabForBrowser(browser);
|
||||
let tab;
|
||||
tab = tabbrowser.getTabForBrowser(browser);
|
||||
return tabbrowser.getFindBar(tab);
|
||||
},
|
||||
|
||||
|
@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
||||
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
||||
}
|
||||
|
||||
PDFJS.version = '1.1.165';
|
||||
PDFJS.build = '39d2103';
|
||||
PDFJS.version = '1.1.215';
|
||||
PDFJS.build = 'c9a7498';
|
||||
|
||||
(function pdfjsWrapper() {
|
||||
// Use strict in our context only - users might not want it
|
||||
@ -4208,7 +4208,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||
}
|
||||
|
||||
var name = fontObj.loadedName || 'sans-serif';
|
||||
var bold = fontObj.black ? (fontObj.bold ? 'bolder' : 'bold') :
|
||||
var bold = fontObj.black ? (fontObj.bold ? '900' : 'bold') :
|
||||
(fontObj.bold ? 'bold' : 'normal');
|
||||
|
||||
var italic = fontObj.italic ? 'italic' : 'normal';
|
||||
@ -4468,6 +4468,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||
if (isTextInvisible || fontSize === 0) {
|
||||
return;
|
||||
}
|
||||
this.cachedGetSinglePixelWidth = null;
|
||||
|
||||
ctx.save();
|
||||
ctx.transform.apply(ctx, current.textMatrix);
|
||||
|
126
browser/extensions/pdfjs/content/build/pdf.worker.js
vendored
126
browser/extensions/pdfjs/content/build/pdf.worker.js
vendored
@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
|
||||
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
||||
}
|
||||
|
||||
PDFJS.version = '1.1.165';
|
||||
PDFJS.build = '39d2103';
|
||||
PDFJS.version = '1.1.215';
|
||||
PDFJS.build = 'c9a7498';
|
||||
|
||||
(function pdfjsWrapper() {
|
||||
// Use strict in our context only - users might not want it
|
||||
@ -2062,17 +2062,33 @@ var Page = (function PageClosure() {
|
||||
return this.pageDict.get(key);
|
||||
},
|
||||
|
||||
getInheritedPageProp: function Page_inheritPageProp(key) {
|
||||
var dict = this.pageDict;
|
||||
var value = dict.get(key);
|
||||
while (value === undefined) {
|
||||
dict = dict.get('Parent');
|
||||
if (!dict) {
|
||||
getInheritedPageProp: function Page_getInheritedPageProp(key) {
|
||||
var dict = this.pageDict, valueArray = null, loopCount = 0;
|
||||
var MAX_LOOP_COUNT = 100;
|
||||
// Always walk up the entire parent chain, to be able to find
|
||||
// e.g. \Resources placed on multiple levels of the tree.
|
||||
while (dict) {
|
||||
var value = dict.get(key);
|
||||
if (value) {
|
||||
if (!valueArray) {
|
||||
valueArray = [];
|
||||
}
|
||||
valueArray.push(value);
|
||||
}
|
||||
if (++loopCount > MAX_LOOP_COUNT) {
|
||||
warn('Page_getInheritedPageProp: maximum loop count exceeded.');
|
||||
break;
|
||||
}
|
||||
value = dict.get(key);
|
||||
dict = dict.get('Parent');
|
||||
}
|
||||
return value;
|
||||
if (!valueArray) {
|
||||
return Dict.empty;
|
||||
}
|
||||
if (valueArray.length === 1 || !isDict(valueArray[0]) ||
|
||||
loopCount > MAX_LOOP_COUNT) {
|
||||
return valueArray[0];
|
||||
}
|
||||
return Dict.merge(this.xref, valueArray);
|
||||
},
|
||||
|
||||
get content() {
|
||||
@ -2080,14 +2096,10 @@ var Page = (function PageClosure() {
|
||||
},
|
||||
|
||||
get resources() {
|
||||
var value = this.getInheritedPageProp('Resources');
|
||||
// For robustness: The spec states that a \Resources entry has to be
|
||||
// present, but can be empty. Some document omit it still. In this case
|
||||
// return an empty dictionary:
|
||||
if (value === undefined) {
|
||||
value = Dict.empty;
|
||||
}
|
||||
return shadow(this, 'resources', value);
|
||||
// present, but can be empty. Some document omit it still, in this case
|
||||
// we return an empty dictionary.
|
||||
return shadow(this, 'resources', this.getInheritedPageProp('Resources'));
|
||||
},
|
||||
|
||||
get mediaBox() {
|
||||
@ -2360,6 +2372,10 @@ var PDFDocument = (function PDFDocumentClosure() {
|
||||
PDFDocument.prototype = {
|
||||
parse: function PDFDocument_parse(recoveryMode) {
|
||||
this.setup(recoveryMode);
|
||||
var version = this.catalog.catDict.get('Version');
|
||||
if (isName(version)) {
|
||||
this.pdfFormatVersion = version.name;
|
||||
}
|
||||
try {
|
||||
// checking if AcroForm is present
|
||||
this.acroForm = this.catalog.catDict.get('AcroForm');
|
||||
@ -2461,8 +2477,10 @@ var PDFDocument = (function PDFDocumentClosure() {
|
||||
}
|
||||
version += String.fromCharCode(ch);
|
||||
}
|
||||
// removing "%PDF-"-prefix
|
||||
this.pdfFormatVersion = version.substring(5);
|
||||
if (!this.pdfFormatVersion) {
|
||||
// removing "%PDF-"-prefix
|
||||
this.pdfFormatVersion = version.substring(5);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// May not be a PDF file, continue anyway.
|
||||
@ -2739,6 +2757,24 @@ var Dict = (function DictClosure() {
|
||||
|
||||
Dict.empty = new Dict(null);
|
||||
|
||||
Dict.merge = function Dict_merge(xref, dictArray) {
|
||||
var mergedDict = new Dict(xref);
|
||||
|
||||
for (var i = 0, ii = dictArray.length; i < ii; i++) {
|
||||
var dict = dictArray[i];
|
||||
if (!isDict(dict)) {
|
||||
continue;
|
||||
}
|
||||
for (var keyName in dict.map) {
|
||||
if (mergedDict.map[keyName]) {
|
||||
continue;
|
||||
}
|
||||
mergedDict.map[keyName] = dict.map[keyName];
|
||||
}
|
||||
}
|
||||
return mergedDict;
|
||||
};
|
||||
|
||||
return Dict;
|
||||
})();
|
||||
|
||||
@ -5213,7 +5249,10 @@ var PDFFunction = (function PDFFunctionClosure() {
|
||||
var rmin = encode[2 * i];
|
||||
var rmax = encode[2 * i + 1];
|
||||
|
||||
tmpBuf[0] = rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);
|
||||
// Prevent the value from becoming NaN as a result
|
||||
// of division by zero (fixes issue6113.pdf).
|
||||
tmpBuf[0] = dmin === dmax ? rmin :
|
||||
rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);
|
||||
|
||||
// call the appropriate function
|
||||
fns[i](tmpBuf, 0, dest, destOffset);
|
||||
@ -6222,9 +6261,9 @@ var ColorSpace = (function ColorSpaceClosure() {
|
||||
error('unrecognized colorspace ' + mode);
|
||||
}
|
||||
} else if (isArray(cs)) {
|
||||
mode = cs[0].name;
|
||||
mode = xref.fetchIfRef(cs[0]).name;
|
||||
this.mode = mode;
|
||||
var numComps, params;
|
||||
var numComps, params, alt;
|
||||
|
||||
switch (mode) {
|
||||
case 'DeviceGray':
|
||||
@ -6246,6 +6285,17 @@ var ColorSpace = (function ColorSpaceClosure() {
|
||||
var stream = xref.fetchIfRef(cs[1]);
|
||||
var dict = stream.dict;
|
||||
numComps = dict.get('N');
|
||||
alt = dict.get('Alternate');
|
||||
if (alt) {
|
||||
var altIR = ColorSpace.parseToIR(alt, xref, res);
|
||||
// Parse the /Alternate CS to ensure that the number of components
|
||||
// are correct, and also (indirectly) that it is not a PatternCS.
|
||||
var altCS = ColorSpace.fromIR(altIR);
|
||||
if (altCS.numComps === numComps) {
|
||||
return altIR;
|
||||
}
|
||||
warn('ICCBased color space: Ignoring incorrect /Alternate entry.');
|
||||
}
|
||||
if (numComps === 1) {
|
||||
return 'DeviceGrayCS';
|
||||
} else if (numComps === 3) {
|
||||
@ -6255,7 +6305,7 @@ var ColorSpace = (function ColorSpaceClosure() {
|
||||
}
|
||||
break;
|
||||
case 'Pattern':
|
||||
var basePatternCS = cs[1];
|
||||
var basePatternCS = xref.fetchIfRef(cs[1]) || null;
|
||||
if (basePatternCS) {
|
||||
basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res);
|
||||
}
|
||||
@ -6278,11 +6328,11 @@ var ColorSpace = (function ColorSpaceClosure() {
|
||||
} else if (isArray(name)) {
|
||||
numComps = name.length;
|
||||
}
|
||||
var alt = ColorSpace.parseToIR(cs[2], xref, res);
|
||||
alt = ColorSpace.parseToIR(cs[2], xref, res);
|
||||
var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3]));
|
||||
return ['AlternateCS', numComps, alt, tintFnIR];
|
||||
case 'Lab':
|
||||
params = cs[1].getAll();
|
||||
params = xref.fetchIfRef(cs[1]).getAll();
|
||||
return ['LabCS', params];
|
||||
default:
|
||||
error('unimplemented color space object "' + mode + '"');
|
||||
@ -16333,12 +16383,14 @@ var Font = (function FontClosure() {
|
||||
case 0x7F: // Control char
|
||||
case 0xA0: // Non breaking space
|
||||
case 0xAD: // Soft hyphen
|
||||
case 0x0E33: // Thai character SARA AM
|
||||
case 0x2011: // Non breaking hyphen
|
||||
case 0x205F: // Medium mathematical space
|
||||
case 0x25CC: // Dotted circle (combining mark)
|
||||
return true;
|
||||
}
|
||||
if ((code & ~0xFF) === 0x0E00) { // Thai/Lao chars (with combining mark)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -17762,13 +17814,18 @@ var Font = (function FontClosure() {
|
||||
}
|
||||
}
|
||||
|
||||
var charCodeToGlyphId = [], charCode, toUnicode = properties.toUnicode;
|
||||
var charCodeToGlyphId = [], charCode;
|
||||
var toUnicode = properties.toUnicode, widths = properties.widths;
|
||||
var isIdentityUnicode = toUnicode instanceof IdentityToUnicodeMap;
|
||||
|
||||
function hasGlyph(glyphId, charCode) {
|
||||
function hasGlyph(glyphId, charCode, widthCode) {
|
||||
if (!missingGlyphs[glyphId]) {
|
||||
return true;
|
||||
}
|
||||
if (charCode >= 0 && toUnicode.has(charCode)) {
|
||||
if (!isIdentityUnicode && charCode >= 0 && toUnicode.has(charCode)) {
|
||||
return true;
|
||||
}
|
||||
if (widths && widthCode >= 0 && isNum(widths[widthCode])) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -17788,7 +17845,7 @@ var Font = (function FontClosure() {
|
||||
}
|
||||
|
||||
if (glyphId >= 0 && glyphId < numGlyphs &&
|
||||
hasGlyph(glyphId, charCode)) {
|
||||
hasGlyph(glyphId, charCode, cid)) {
|
||||
charCodeToGlyphId[charCode] = glyphId;
|
||||
}
|
||||
});
|
||||
@ -17849,18 +17906,19 @@ var Font = (function FontClosure() {
|
||||
var found = false;
|
||||
for (i = 0; i < cmapMappingsLength; ++i) {
|
||||
if (cmapMappings[i].charCode === unicodeOrCharCode &&
|
||||
hasGlyph(cmapMappings[i].glyphId, unicodeOrCharCode)) {
|
||||
hasGlyph(cmapMappings[i].glyphId, unicodeOrCharCode, -1)) {
|
||||
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && properties.glyphNames) {
|
||||
// Try to map using the post table. There are currently no known
|
||||
// pdfs that this fixes.
|
||||
// Try to map using the post table.
|
||||
var glyphId = properties.glyphNames.indexOf(glyphName);
|
||||
if (glyphId > 0 && hasGlyph(glyphId, -1)) {
|
||||
if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) {
|
||||
charCodeToGlyphId[charCode] = glyphId;
|
||||
} else {
|
||||
charCodeToGlyphId[charCode] = 0; // notdef
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -803,7 +803,7 @@ html[dir='rtl'] .dropdownToolbarButton {
|
||||
.dropdownToolbarButton {
|
||||
width: 120px;
|
||||
max-width: 120px;
|
||||
padding: 3px 2px 2px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background: url(images/toolbarButton-menuArrows.png) no-repeat;
|
||||
}
|
||||
@ -819,7 +819,7 @@ html[dir='rtl'] .dropdownToolbarButton {
|
||||
font-size: 12px;
|
||||
color: hsl(0,0%,95%);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding: 3px 2px 2px;
|
||||
border: none;
|
||||
background: rgba(0,0,0,0); /* Opera does not support 'transparent' <select> background */
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -66,30 +66,174 @@ const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
|
||||
|
||||
// Only allow explicitly approved frecent sites with display name
|
||||
const ALLOWED_FRECENT_SITES = new Map([
|
||||
[ 'airdroid.com,android-developers.blogspot.com,android.com,androidandme.com,androidapplications.com,androidapps.com,androidauthority.com,androidcentral.com,androidcommunity.com,androidfilehost.com,androidforums.com,androidguys.com,androidheadlines.com,androidpit.com,androidpolice.com,androidspin.com,androidtapp.com,androinica.com,droid-life.com,droidforums.net,droidviews.com,droidxforums.com,forum.xda-developers.com,phandroid.com,play.google.com,shopandroid.com,talkandroid.com,theandroidsoul.com,thedroidguy.com,videodroid.org',
|
||||
'Technology' ],
|
||||
[ 'assurancewireless.com,att.com,attsavings.com,boostmobile.com,budgetmobile.com,consumercellular.com,credomobile.com,gosmartmobile.com,h2owirelessnow.com,lycamobile.com,lycamobile.us,metropcs.com,myfamilymobile.com,polarmobile.com,qlinkwireless.com,republicwireless.com,sprint.com,straighttalk.com,t-mobile.com,tracfonewireless.com,verizonwireless.com,virginmobile.com,virginmobile.com.au,virginmobileusa.com,vodafone.co.uk,vodafone.com,vzwshop.com',
|
||||
'Mobile Phone' ],
|
||||
[ '1800petmeds.com,800petmeds.com,adopt.dogtime.com,adoptapet.com,akc.org,americanhumane.org,animal.discovery.com,animalconcerns.org,animalshelter.org,arcatapet.com,aspca.org,avma.org,bestfriends.org,blog.petmeds.com,buddydoghs.com,carealotpets.com,dailypuppy.com,dog.com,dogbar.com,dogbreedinfo.com,drsfostersmith.com,entirelypets.com,farmsanctuary.org,farmusa.org,freekibble.com,freekibblekat.com,healthypets.com,hsus.org,humanesociety.org,liveaquaria.com,marinedepot.com,medi-vet.com,nationalpetpharmacy.com,nsalamerica.org,nycacc.org,ohmydogsupplies.com,pet-dog-cat-supply-store.com,petcarerx.com,petco.com,petdiscounters.com,petedge.com,peteducation.com,petfinder.com,petfooddirect.com,petguys.com,petharbor.com,petmountain.com,petplanet.co.uk,pets911.com,petsmart.com,petsuppliesplus.com,puppyfind.com,revivalanimal.com,terrificpets.com,thatpetplace.com,theanimalrescuesite.com,theanimalrescuesite.greatergood.com,thefluffingtonpost.com,therainforestsite.com,vetdepot.com',
|
||||
'pet' ],
|
||||
[ '1aauto.com,autoblog.com,autoguide.com,autosite.com,autoweek.com,bimmerpost.com,bmwblog.com,boldride.com,caranddriver.com,carcomplaints.com,carspoon.com,cherokeeforum.com,classiccars.com,commercialtrucktrader.com,corvetteforum.com,dealerrater.com,ebizautos.com,ford-trucks.com,hemmings.com,jalopnik.com,jeepforum.com,jeepsunlimited.com,jk-forum.com,legendaryspeed.com,motorauthority.com,motortrend.com,motorwings.com,odometer.com,pirate4x4.com,purecars.com,roadandtrack.com,teslamotorsclub.com,topgear.com,topspeed.com,totalmini.com,truckpaper.com,wranglerforum.com',
|
||||
'auto' ],
|
||||
[ 'autobytel.com,autocheck.com,automotive.com,autonation.com,autos.aol.com,autos.msn.com,autos.yahoo.com,autotrader.autos.msn.com,autotrader.com,autotraderclassics.com,autoweb.com,car.com,carbuyingtips.com,carfax.com,cargurus.com,carmax.com,carprices.com,cars.com,cars.oodle.com,carsdirect.com,carsforsale.com,edmunds.com,hertzcarsales.com,imotors.com,intellichoice.com,internetautoguide.com,kbb.com,lemonfree.com,nada.com,nadaguides.com,thecarconnection.com,thetruthaboutcars.com,truecar.com,usedcars.com,usnews.rankingsandreviews.com',
|
||||
'auto' ],
|
||||
[ 'acura.com,audi.ca,audi.com,audiusa.com,automobiles.honda.com,bentleymotors.com,bmw.com,bmwusa.com,buick.com,buyatoyota.com,cadillac.com,cars.mclaren.com,chevrolet.com,choosenissan.com,chrysler.com,daimler.com,dodge.com,ferrari.com/en_us,fiskerautomotive.com,ford.com,gm.com,gmc.com,hummer.com,hyundai.com,hyundaiusa.com,infiniti.com,infinitiusa.com,jaguarusa.com,jeep.com,kia.com,kiamotors.com,lamborghini.com/en/home,landrover.com,landroverusa.com,lexus.com,lincoln.com,maserati.us,mazda.com,mazdausa.com,mbusa.com,mbusi.com,mercedes-amg.com,mercedes-benz.com,mercuryvehicles.com,miniusa.com,nissanusa.com,pontiac.com,porsche.com/usa,ramtrucks.com,rolls-roycemotorcars.com,saturn.com,scion.com,subaru.com,teslamotors.com,toyota.com,volkswagen.co.uk,volkswagen.com,volvocars.com/us,vw.com',
|
||||
'auto' ],
|
||||
[ '1010tires.com,4wheelparts.com,advanceautoparts.com,andysautosport.com,autoanything.com,autogeek.net,autopartsgiant.com,autopartswarehouse.com,autotrucktoys.com,autozone.com,autozoneinc.com,bavauto.com,bigotires.com,bilsteinus.com,brembo.com,car-part.com,carid.com,carparts.com,carquest.com,dinancars.com,discounttire.com,discounttiredirect.com,firestonecompleteautocare.com,goodyear.com,hrewheels,jcwhitney.com,kw-suspensions.com,momousa.com,napaonline.com,onlinetires.com,oreillyauto.com,oriellysautoparts.com,pepboys.com,repairpal.com,rockauto.com,shop.advanceautoparts.com,slickcar.com,stoptech.com,streetbeatcustoms.com,summitracing.com,tirebuyer.com,tirerack.com,tiresplus.com,tsw.com,velocitymotoring.com,wheelmax.com',
|
||||
'auto parts' ],
|
||||
[ 'abebooks.co.uk,abebooks.com,addall.com,alibris.com,allaboutcircuits.com,allbookstores.com,allyoucanbooks.com,answersingenesis.org,artnet.com,audiobooks.com,barnesandnoble.com,barnesandnobleinc.com,bartleby.com,betterworldbooks.com,biblio.com,biggerbooks.com,bncollege.com,bookbyte.com,bookdepository.com,bookfinder.com,bookrenter.com,booksamillion.com,booksite.com,boundless.com,brookstone.com,btol.com,calibre-ebook.com,campusbookrentals.com,casadellibro.com,cbomc.com,cengagebrain.com,chapters.indigo.ca,christianbook.com,ciscopress.com,coursesmart.com,cqpress.com,crafterschoice.com,crossings.com,cshlp.org,deseretbook.com,directtextbook.com,discountmags.com,doubledaybookclub.com,doubledaylargeprint.com,doverpublications.com,ebooks.com,ecampus.com,fellabooks.net,fictionwise.com,flatworldknowledge.com,goodreads.com,grolier.com,harpercollins.com,hayhouse.com,historybookclub.com,hpb.com,hpbmarketplace.com,interweave.com,iseeme.com,katiekazoo.com,knetbooks.com,learnoutloud.com,librarything.com,literaryguild.com,lulu.com,lww.com,macmillan.com,magazines.com,mbsdirect.net,militarybookclub.com,mypearsonstore.com,mysteryguild.com,netplaces.com,noble.com,novelguide.com,onespirit.com,oxfordjournals.org,paperbackswap.com,papy.co.jp,peachpit.com,penguin.com,penguingroup.com,pimsleur.com,powells.com,qpb.com,quepublishing.com,reviews.com,rhapsodybookclub.com,rodalestore.com,royalsocietypublishing.org,sagepub.com,scrubsmag.com,sfbc.com,simonandschuster.com,simonandschuster.net,simpletruths.com,teach12.net,textbooks.com,textbookx.com,thegoodcook.com,thriftbooks.com,tlsbooks.com,toshibabookplace.com,tumblebooks.com,urbookdownload.com,usedbooksearch.co.uk,valorebooks.com,valuemags.com,vialibri.net,wwnorton.com,zoobooks.com',
|
||||
'literature' ],
|
||||
[ '53.com,ally.com,bankofamerica.com,bbt.com,bnymellon.com,capitalone.com/bank/,chase.com,citi.com,citibank.com,citizensbank.com,citizensbankonline.com,creditonebank.com,everbank.com,hsbc.com,key.com,pnc.com,pncbank.com,rbs.co.uk,regions.com,sovereignbank.com,suntrust.com,tdbank.com,usaa.com,usbank.com,wachovia.com,wamu.com,wellsfargo.com,wsecu.org',
|
||||
'banking' ],
|
||||
[ '247wallst.com,bizjournals.com,bloomberg.com,businessweek.com,cnbc.com,cnnmoney.com,dowjones.com,easyhomesite.com,economist.com,entrepreneur.com,fastcompany.com,finance.yahoo.com,forbes.com,fortune.com,foxbusiness.com,ft.com,hbr.org,ibtimes.com,inc.com,manta.com,marketwatch.com,newsweek.com,online.wsj.com,qz.com,reuters.com,smartmoney.com,wsj.com',
|
||||
'business news' ],
|
||||
[ 'achievecard.com,americanexpress.com,barclaycardus.com,card.com,citicards.com,comparecards.com,creditcards.citi.com,discover.com,discovercard.com,experian.com,skylightpaycard.com,squareup.com,visa.com,visabuxx.com,visaextras.com',
|
||||
'finance' ],
|
||||
[ 'alliantcreditunion.org,connexuscu.org,lmcu.org,nasafcu.com,navyfcu.org,navyfederal.org,penfed.org,sccu.com,suncoastcreditunion.com,tinkerfcu.org,veridiancu.org',
|
||||
'finance' ],
|
||||
[ 'allbusiness.com,bankrate.com,buyersellertips.com,cboe.com,cnbcprime.com,coindesk.com,dailyfinance.com,dailyfx.com,dealbreaker.com,easierstreetdaily.com,economywatch.com,etfdailynews.com,etfdb.com,financeformulas.net,finviz.com,fool.com,forexpros.com,forexthreads.com,ftpress.com,fx-exchange.com,insidermonkey.com,investmentu.com,investopedia.com,investorjunkie.com,investors.com,kiplinger.com,minyanville.com,moneymorning.com,moneyning.com,moneysavingexpert.com,morningstar.com,nakedcapitalism.com,ncsoft.net,oilprice.com,realclearmarkets.com,rttnews.com,seekingalpha.com,silverdoctors.com,stockcharts.com,stockpickr.com,thefinancials.com,thestreet.com,wallstreetinsanity.com,wikinvest.com,xe.com,youngmoney.com',
|
||||
'investing' ],
|
||||
[ 'edwardjones.com,fidelity.com,goldmansachs.com,jpmorgan.com,ml.com,morganstanley.com,mymerrill.com,personal.vanguard.com,principal.com,schwab.com,schwabplan.com,scottrade.com,tdameritrade.com,troweprice.com,vanguard.com',
|
||||
'investing' ],
|
||||
[ '247lendinggroup.com,americanoneunsecured.com,avant.com,bestegg.com,chasestudentloans.com,eloan.com,gofundme.com,guidetolenders.com,kiva.org,lendacademy.com,lendingclub.com,lendingtree.com,lightstream.com,loanio.com,manageyourloans.com,meetearnest.com,microplace.com,netcredit.com,peer-lend.com,personalloans.com,prosper.com,salliemae.com,sofi.com,springleaf.com,uk.zopa.com,upstart.com',
|
||||
'finance' ],
|
||||
[ 'betterment.com,blooom.com,futureadvisor.com,kapitall.com,motifinvesting.com,personalcapital.com,wealthfront.com,wisebanyan.com',
|
||||
'investing' ],
|
||||
[ 'bancdebinary.com,cherrytrade.com,empireoption.net,etrade.com,firstrade.com,forex.com,interactivebrokers.com,ishares.com,optionsxpress.com,sharebuilder.com,thinkorswim.com,tradeking.com,trademonster.com,us.etrade.com,zecco.com',
|
||||
'finance' ],
|
||||
[ 'annualcreditreport.com,bluebird.com,credio.com,creditkarma.com,creditreport.com,cybersource.com,equifax.com,freecreditreport.com,freecreditscore.com,freedomdebtrelief.com,freescoreonline.com,mint.com,moneymappress.com,myfico.com,nationaldebtrelief.com,onesmartpenny.com,paypal.com,transunion.com,truecredit.com,upromise.com,vuebill.com,xpressbillpay.com,youneedabudget.com',
|
||||
'personal finance' ],
|
||||
[ 'angieslist.com,bloomberg.com,businessinsider.com,buydomains.com,domain.com,entrepreneur.com,fastcompany.com,forbes.com,fortune.com,godaddy.com,inc.com,manta.com,nytimes.com,openforum.com,register.com,salesforce.com,sba.gov,sbomag.com,shopsmall.americanexpress.com,smallbusiness.yahoo.com,squarespace.com,startupjournal.com,startupnation.com,weebly.com,wordpress.com,youngentrepreneur.com',
|
||||
'business news' ],
|
||||
[ '1040now.net,24hourtax.com,acttax.com,comparetaxsoftware.org,e-file.com,etax.com,free1040taxreturn.com,hrblock.com,intuit.com,irstaxdoctors.com,libertytax.com,octaxcol.com,pay1040.com,priortax.com,quickbooks.com,quickrefunds.com,rapidtax.com,refundschedule.com,taxact.com,taxactonline.com,taxefile.com,taxhead.com,taxhelptoday.me,taxsimple.org,turbotax.com',
|
||||
'tax' ],
|
||||
[ 'adeccousa.com,americasjobexchange.com,aoljobs.com,applicantpro.com,applicantstack.com,apply-4-jobs.com,apply2jobs.com,att.jobs,beyond.com,careerboutique.com,careerbuilder.com,careerflash.net,careerslocal.net,climber.com,coverlettersandresume.com,dice.com,diversityonecareers.com,employmentguide.com,everyjobforme.com,experteer.com,find.ly,findtherightjob.com,freelancer.com,gigats.com,glassdoor.com,governmentjobs.com,hrapply.com,hrdepartment.com,hrsmart.com,ihire.com,indeed.com,internships.com,itsmycareer.com,job-applications.com,job-hunt.org,job-interview-site.com,job.com,jobcentral.com,jobdiagnosis.com,jobhat.com,jobing.com,jobrapido.com,jobs.aol.com,jobs.net,jobsbucket.com,jobsflag.com,jobsgalore.com,jobsonline.com,jobsradar.com,jobster.com,jobtorch.com,jobungo.com,jobvite.com,juju.com,linkedin.com,livecareer.com,localjobster.com,mindtools.com,monster.com,myjobhelper.com,myperfectresume.com,payscale.com,pryor.com,quintcareers.com,randstad.com,recruitingcenter.net,resume-library.com,resume-now.com,roberthalf.com,salary.com,salaryexpert.com,simplyhired.com,smartrecruiters.com,snagajob.com,startwire.com,theladders.com,themuse.com,theresumator.com,thingamajob.com,usajobs.gov,ziprecruiter.com',
|
||||
'career services' ],
|
||||
[ 'americanheart.org,americanredcross.com,americares.org,catholiccharitiesusa.org,charitybuzz.com,charitynavigator.org,charitywater.org,directrelief.org,fao.org,habitat.org,hrw.org,imf.org,mskcc.org,ohchr.org,redcross.org,reliefweb.int,salvationarmyusa.org,savethechildren.org,un.org,undp.org,unep.org,unesco.org,unfpa.org,unhcr.org,unicef.org,unicefusa.org,unops.org,volunteermatch.org,wfp.org,who.int,worldbank.org',
|
||||
'philanthropic' ],
|
||||
[ 'academia.edu,albany.edu,american.edu,amity.edu,annauniv.edu,apus.edu,arizona.edu,ashford.edu,asu.edu,auburn.edu,austincc.edu,baylor.edu,bc.edu,berkeley.edu,brandeis.edu,brookings.edu,brown.edu,bu.edu,buffalo.edu,byu.edu,calpoly.edu,calstate.edu,caltech.edu,cam.ac.uk,cambridge.org,capella.edu,case.edu,clemson.edu,cmu.edu,colorado.edu,colostate-pueblo.edu,colostate.edu,columbia.edu,commnet.edu,cornell.edu,cpp.edu,csulb.edu,csun.edu,csus.edu,cuny.edu,cwru.edu,dartmouth.edu,depaul.edu,devry.edu,drexel.edu,du.edu,duke.edu,emory.edu,fau.edu,fcps.edu,fiu.edu,fordham.edu,fsu.edu,fullerton.edu,fullsail.edu,gatech.edu,gcu.edu,georgetown.edu,gmu.edu,gsu.edu,gwu.edu,harvard.edu,hawaii.edu,hbs.edu,iastate.edu,iit.edu,illinois.edu,indiana.edu,iu.edu,jhu.edu,k-state.edu,kent.edu,ku.edu,lamar.edu,liberty.edu,losrios.edu,lsu.edu,luc.edu,maine.edu,maricopa.edu,mass.edu,miami.edu,miamioh.edu,missouri.edu,mit.edu,mnscu.edu,monash.edu,msu.edu,mtu.edu,nau.edu,ncsu.edu,nd.edu,neu.edu,njit.edu,northeastern.edu,northwestern.edu,nova.edu,nyu.edu,odu.edu,ohio-state.edu,ohio.edu,okstate.edu,oregonstate.edu,osu.edu,ou.edu,ox.ac.uk,pdx.edu,pearson.com,phoenix.edu,pitt.edu,princeton.edu,psu.edu,purdue.edu,regis.edu,rice.edu,rit.edu,rochester.edu,rpi.edu,rutgers.edu,sc.edu,scu.edu,sdsu.edu,seattleu.edu,sfsu.edu,si.edu,sjsu.edu,snhu.edu,stanford.edu,stonybrook.edu,suny.edu,syr.edu,tamu.edu,temple.edu,towson.edu,ttu.edu,tufts.edu,ua.edu,uark.edu,ub.edu,uc.edu,uccs.edu,ucdavis.edu,ucf.edu,uchicago.edu,uci.edu,ucla.edu,uconn.edu,ucr.edu,ucsb.edu,ucsc.edu,ucsd.edu,ucsf.edu,udel.edu,udemy.com,ufl.edu,uga.edu,uh.edu,uic.edu,uillinois.edu,uiowa.edu,uiuc.edu,uky.edu,umass.edu,umb.edu,umbc.edu,umd.edu,umich.edu,umn.edu,umuc.edu,unc.edu,uncc.edu,unf.edu,uniminuto.edu,universityofcalifornia.edu,unl.edu,unlv.edu,unm.edu,unt.edu,uoc.edu,uoregon.edu,upc.edu,upenn.edu,upi.edu,uri.edu,usc.edu,usf.edu,usg.edu,usu.edu,uta.edu,utah.edu,utdallas.edu,utexas.edu,utk.edu,uvm.edu,uw.edu,uwm.edu,vanderbilt.edu,vccs.edu,vcu.edu,virginia.edu,vt.edu,waldenu.edu,washington.edu,wayne.edu,wednet.edu,wgu.edu,wisc.edu,wisconsin.edu,wm.edu,wmich.edu,wsu.edu,wustl.edu,wvu.edu,yale.edu',
|
||||
'college' ],
|
||||
[ 'collegeboard.com,collegeconfidential.com,collegeview.com,ecollege.com,finaid.org,find-colleges-now.com,ratemyprofessors.com,ratemyteachers.com,studentsreview.com',
|
||||
'college' ],
|
||||
[ 'actstudent.org,adaptedmind.com,aesoponline.com,archives.com,bibme.org,blackboard.com,bookrags.com,cengage.com,chegg.com,classdojo.com,classzone.com,cliffsnotes.com,coursecompass.com,educationconnection.com,educationdynamics.com,ets.org,familysearch.org,fastweb.com,genealogy.com,gradesaver.com,instructure.com,khanacademy.org,learn4good.com,mathway.com,mathxl.com,mcgraw-hill.com,merriam-webster.com,mheducation.com,niche.com,openstudy.com,pearsoned.com,pearsonmylabandmastering.com,pearsonsuccessnet.com,poptropica.com,powerschool.com,proprofs.com,purplemath.com,quizlet.com,readwritethink.org,renlearn.com,rhymezone.com,schoolloop.com,schoology.com,smithsonianmag.com,sparknotes.com,study.com,studyisland.com,studymode.com,synonym.com,teacherprobs.com,teacherspayteachers.com,tutorvista.com,vocabulary.com,yourschoolmatch.com',
|
||||
'education' ],
|
||||
[ 'browardschools.com,k12.ca.us,k12.fl.us,k12.ga.us,k12.in.us,k12.mn.us,k12.mo.us,k12.nc.us,k12.nj.us,k12.oh.us,k12.va.us,k12.wi.us',
|
||||
'education' ],
|
||||
[ 'coolmath-games.com,coolmath.com,coolmath4kids.com,coolquiz.com,funbrain.com,funtrivia.com,gamesforthebrain.com,girlsgogames.com,hoodamath.com,lumosity.com,math.com,mathsisfun.com,trivia.com,wizard101.com',
|
||||
'learning games' ],
|
||||
[ 'askmen.com,boredomtherapy.com,buzzfeed.com,complex.com,dailymotion.com,elitedaily.com,gawker.com,howstuffworks.com,instagram.com,madamenoire.com,polygon.com,ranker.com,rollingstone.com,ted.com,theblaze.com,thechive.com,thecrux.com,thedailybeast.com,thoughtcatalog.com,uproxx.com,upworthy.com,zergnet.com',
|
||||
'entertainment' ],
|
||||
[ '11points.com,7gid.com,adultswim.com,break.com,cheezburger.com,collegehumor.com,cracked.com,dailydawdle.com,damnlol.com,dumb.com,dumblaws.com,ebaumsworld.com,explosm.net,failblog.org,fun-gallery.com,funnygig.com,funnyjunk.com,funnymama.com,funnyordie.com,funnytear.com,funplus.com,glassgiant.com,goingviralposts.com,gorillamask.net,i-am-bored.com,icanhascheezburger.com,ifunny.com,imjussayin.co,inherentlyfunny.com,izismile.com,jokes.com,keenspot.com,knowyourmeme.com,laughstub.com,memebase.com,mememaker.net,metacafe.com,mylol.com,picslist.com,punoftheday.com,queendom.com,rajnikantvscidjokes.in,regretfulmorning.com,shareonfb.com,somethingawful.com,stupidvideos.com,superfunnyimages.com,thedailywh.at,theonion.com,tosh.comedycentral.com,uberhumor.com,welltimedphotos.com',
|
||||
'humor' ],
|
||||
[ 'air.tv,amctheatres.com,boxofficemojo.com,cinapalace.com,cinaplay.com,cinemablend.com,cinemark.com,cinematical.com,collider.com,comicbookmovie.com,comingsoon.net,crackle.com,denofgeek.us,dreamworks.com,empireonline.com,enstarz.com,fandango.com,filmschoolrejects.com,flickeringmyth.com,flixster.com,fullmovie2k.com,g2g.fm,galleryhip.com,hollywood.com,hollywoodreporter.com,iglomovies.com,imdb.com,indiewire.com,instantwatcher.com,joblo.com,kickass.to,kissdrama.net,marcustheatres.com,megashare9.com,moviefone.com,movieinsider.com,moviemistakes.com,moviepilot.com,movierulz.com,movies.com,movies.yahoo.com,movieseum.com,movietickets.com,movieweb.com,mrmovietimes.com,mymovieshub.com,netflix.com,onlinemovies.pro,pelis24.com,projectfreetv.ch,redbox.com,regmovies.com,repelis.tv,rogerebert.suntimes.com,ropeofsilicon.com,rottentomatoes.com,sidereel.com,slashfilm.com,solarmovie.is,starwars.com,superherohype.com,tcm.com,twomovies.us,variety.com,vimeo.com,viooz.ac,warnerbros.com,watchfree.to,wbredirect.com,youtubeonfire.com,zmovie.tw,zumvo.com',
|
||||
'movie' ],
|
||||
[ '1079ishot.com,2dopeboyz.com,8tracks.com,acdc.com,allaccess.com,allhiphop.com,allmusic.com,audiofanzine.com,audiomack.com,azlyrics.com,baeblemusic.com,bandsintown.com,billboard.com,brooklynvegan.com,brunomars.com,buzznet.com,cmt.com,coachella.com,consequenceofsound.net,contactmusic.com,countryweekly.com,dangerousminds.net,datpiff.com,ddotomen.com,diffuser.fm,directlyrics.com,djbooth.net,eventful.com,fireflyfestival.com,genius.com,guitartricks.com,harmony-central.com,hiphopdx.com,hiphopearly.com,hypem.com,idolator.com,iheart.com,jambase.com,kanyetothe.com,knue.com,lamusica.com,last.fm,livemixtapes.com,loudwire.com,lyricinterpretations.com,lyrics.net,lyricsbox.com,lyricsmania.com,lyricsmode.com,metal-archives.com,metrolyrics.com,mp3.com,mtv.co.uk,myspace.com,newnownext.com,noisetrade.com,okayplayer.com,pandora.com,phish.com,pigeonsandplanes.com,pitchfork.com,popcrush.com,radio.com,rap-up.com,rdio.com,reverbnation.com,revolvermag.com,rockhall.com,saavn.com,songlyrics.com,soundcloud.com,spin.com,spinrilla.com,spotify.com,stereogum.com,stereotude.com,talkbass.com,tasteofcountry.com,thebacklot.com,theboombox.com,theboot.com,thissongissick.com,tunesbaby.com,ultimate-guitar.com,ultimateclassicrock.com,vevo.com,vibe.com,vladtv.com,whosampled.com,wikibit.me,worldstarhiphop.com,wyrk.com,xxlmag.com',
|
||||
'music' ],
|
||||
[ 'aceshowbiz.com,aintitcoolnews.com,allkpop.com,askkissy.com,atraf.co.il,audioboom.com,beamly.com,beyondhollywood.com,blastr.com,blippitt.com,bollywoodlife.com,bossip.com,buzzlamp.com,buzzsugar.com,cambio.com,celebdirtylaundry.com,celebrity-gossip.net,celebuzz.com,chisms.net,comicsalliance.com,concertboom.com,crushable.com,cultbox.co.uk,dailyentertainmentnews.com,dayscafe.com,deadline.com,deathandtaxesmag.com,diaryofahollywoodstreetking.com,digitalspy.com,dlisted.com,egotastic.com,empirenews.net,enelbrasero.com,eonline.com,etonline.com,ew.com,extratv.com,facade.com,famousfix.com,fanaru.com,fanpop.com,fansshare.com,fhm.com,geektyrant.com,glamourpage.com,gossipcenter.com,gossipcop.com,heatworld.com,hlntv.com,hollyscoop.com,hollywoodlife.com,hollywoodtuna.com,hypable.com,infotransfer.net,insideedition.com,interaksyon.com,jezebel.com,justjared.buzznet.com,justjared.com,justjaredjr.com,komando.com,koreaboo.com,laineygossip.com,maxgo.com,maxim.com,maxviral.com,mediatakeout.com,mosthappy.com,moviestalk.com,my.ology.com,nationalenquirer.com,necolebitchie.com,ngoisao.net,nofilmschool.com,nolocreo.com,octane.tv,okmagazine.com,ouchpress.com,people.com,peopleenespanol.com,perezhilton.com,pinkisthenewblog.com,platotv.tv,playbill.com,playbillvault.com,playgroundmag.net,popsugar.com,purepeople.com,radaronline.com,rantchic.com,realitytea.com,reshareworthy.com,rinkworks.com,ripbird.com,sara-freder.com,screencrush.com,screenjunkies.com,soapcentral.com,soapoperadigest.com,sobadsogood.com,socialitelife.com,sourcefednews.com,splitsider.com,starcasm.net,starmagazine.com,starpulse.com,straightfromthea.com,stupiddope.com,tbn.org,theawesomedaily.com,theawl.com,thefrisky.com,thefw.com,thehollywoodgossip.com,theresacaputo.com,thesuperficial.com,thezooom.com,tmz.com,tvnotas.com.mx,twanatells.com,usmagazine.com,vanityfair.com,vanswarpedtour.com,vietgiaitri.com,viral.buzz,vulture.com,wakavision.com,worthytales.net,wwtdd.com',
|
||||
'entertainment news' ],
|
||||
[ 'abc.go.com,abcfamily.go.com,abclocal.go.com,accesshollywood.com,aetv.com,amctv.com,animalplanet.com,bbcamerica.com,bet.com,biography.com,bravotv.com,cartoonnetwork.com,cbn.com,cbs.com,cc.com,centrictv.com,cinemax.com,comedycentral.com,ctv.ca,cwtv.com,daytondailynews.com,drphil.com,dsc.discovery.com,fox.com,fox23.com,fox4news.com,fxnetworks.com,hbo.com,history.com,hulu.com,ifc.com,iqiyi.com,jeopardy.com,kfor.com,logotv.com,mtv.com,myfoxchicago.com,myfoxdc.com,myfoxmemphis.com,myfoxphilly.com,nbc.com,nbcchicago.com,oxygen.com,pbs.org,pbskids.org,rachaelrayshow.com,rtve.es,scifi.com,sho.com,showtimeanytime.com,spike.com,sundance.tv,syfy.com,tbs.com,teamcoco.com,telemundo.com,thedoctorstv.com,titantv.com,tlc.com,tlc.discovery.com,tnt.tv,tntdrama.com,tv.com,tvguide.com,tvseriesfinale.com,usanetwork.com,uvidi.com,vh1.com,viki.com,watchcartoononline.com,watchseries-online.ch,wetv.com,wheeloffortune.com,whio.com,wnep.com,wral.com,wtvr.com,xfinitytv.com,yidio.com',
|
||||
'TV show' ],
|
||||
[ 'americanhiking.org,appalachiantrail.org,canadiangeographic.ca,defenders.org,discovermagazine.com,discoveroutdoors.com,dsc.discovery.com,earthtouchnews.com,edf.org,epa.gov,ewg.org,fishngame.org,foe.org,fs.fed.us,geography.about.com,landtrustalliance.org,nationalgeographic.com,nature.com,nrdc.org,nwf.org,outdoorchannel.com,outdoors.org,seedmagazine.com,trcp.org,usda.gov,worldwildlife.org',
|
||||
'environment' ],
|
||||
[ 'abbreviations.com,abcmouse.com,abcya.com,achieve3000.com,ancestry.com,animaljam.com,babble.com,babycenter.com,babynamespedia.com,behindthename.com,bestmomstv.com,brainyquote.com,cafemom.com,citationmachine.net,clubpenguin.com,cutemunchkins.com,discoveryeducation.com,disney.com,easybib.com,education.com,enotes.com,everydayfamily.com,familyeducation.com,gamefaqs.com,greatschools.org,hrw.com,imvu.com,infoplease.com,itsybitsysteps.com,justmommies.com,k12.com,kidsactivitiesblog.com,mathwarehouse.com,mom.me,mom365.com,mommyshorts.com,momswhothink.com,momtastic.com,monsterhigh.com,myheritage.com,nameberry.com,nickmom.com,pampers.com,parenthood.com,parenting.com,parenting.ivillage.com,parents.com,parentsociety.com,raz-kids.com,regentsprep.org,scarymommy.com,scholastic.com,shmoop.com,softschools.com,spanishdict.com,starfall.com,thebump.com,thefreedictionary.com,thenest.com,thinkbabynames.com,todaysparent.com,webkinz.com,whattoexpect.com',
|
||||
'family' ],
|
||||
[ 'americangirl.com,barbie.com,barbiecollectibles.com,cartoonnetworkshop.com,chuckecheese.com,coloring.ws,disney.co.uk,disney.com.au,disney.go.com,disney.in,disneychannel-asia.com,disneyinternational.com,disneyjunior.com,disneylatino.com,disneyme.com,dltk-kids.com,dressupone.com,fantage.com,funbrainjr.com,hotwheels.com,icarly.com,kiwicrate.com,marvel.com,marvelkids.com,mattelgames.com,maxsteel.com,monkeyquest.com,nick-asia.com,nick.co.uk,nick.com,nick.tv,nickelodeon.com.au,nickjr.co.uk,nickjr.com,ninjakiwi.com,notdoppler.com,powerrangers.com,sciencekids.co.nz,search.disney.com,seventeen.com,teennick.com,theslap.com,yepi.com',
|
||||
'family' ],
|
||||
[ 'alabama.gov,archives.gov,bls.gov,ca.gov,cancer.gov,cdc.gov,census.gov,cia.gov,cms.gov,commerce.gov,ct.gov,delaware.gov,dhs.gov,doi.gov,dol.gov,dot.gov,ed.gov,eftps.gov,epa.gov,fbi.gov,fda.gov,fema.gov,flhsmv.gov,ftc.gov,ga.gov,georgia.gov,gpo.gov,hhs.gov,house.gov,hud.gov,illinois.gov,in.gov,irs.gov,justice.gov,ky.gov,loc.gov,louisiana.gov,maryland.gov,mass.gov,michigan.gov,mo.gov,nih.gov,nj.gov,nps.gov,ny.gov,nyc.gov,ohio.gov,ok.gov,opm.gov,oregon.gov,pa.gov,recreation.gov,sba.gov,sc.gov,sec.gov,senate.gov,state.fl.us,state.gov,state.il.us,state.ma.us,state.mi.us,state.mn.us,state.nc.us,state.ny.us,state.oh.us,state.pa.us,studentloans.gov,telldc.com,texas.gov,tn.gov,travel.state.gov,tsa.gov,usa.gov,uscis.gov,uscourts.gov,usda.gov,usdoj.gov,usembassy.gov,usgs.gov,utah.gov,va.gov,virginia.gov,wa.gov,whitehouse.gov,wi.gov,wisconsin.gov',
|
||||
'government' ],
|
||||
[ 'beachbody.com,bodybuilding.com,caloriecount.com,extremefitness.com,fitbit.com,fitday.com,fitnessmagazine.com,fitnessonline.com,fitwatch.com,livestrong.com,maxworkouts.com,mensfitness.com,menshealth.com,muscleandfitness.com,muscleandfitnesshers.com,myfitnesspal.com,shape.com,womenshealthmag.com',
|
||||
'health & fitness' ],
|
||||
[ 'activebeat.com,alliancehealth.com,beyonddiet.com,caring.com,complete-health-and-happiness.com,diabeticconnect.com,doctoroz.com,everydayhealth.com,followmyhealth.com,greatist.com,health.com,healthboards.com,healthcaresource.com,healthgrades.com,healthguru.com,healthination.com,healthtap.com,helpguide.org,iherb.com,kidshealth.org,lifescript.com,lovelivehealth.com,medicaldaily.com,mercola.com,perfectorigins.com,prevention.com,qualityhealth.com,questdiagnostics.com,realself.com,sharecare.com,sparkpeople.com,spryliving.com,steadyhealth.com,symptomfind.com,ucomparehealthcare.com,vitals.com,webmd.com,weightwatchers.com,wellness.com,zocdoc.com',
|
||||
'health & wellness' ],
|
||||
[ 'aetna.com,anthem.com,athenahealth.com,bcbs.com,bluecrossca.com,cigna.benefitnation.net,cigna.com,cigna.healthplan.com,ehealthcare.com,ehealthinsurance.com,empireblue.com,goldenrule.com,healthcare.gov,healthnet.com,humana-medicare.com,humana.com,kaiserpermanente.org,metlife.com,my.cigna.com,mybenefits.metlife.com,myuhc.com,uhc.com,unitedhealthcareonline.com,walterrayholt.com',
|
||||
'health insurance' ],
|
||||
[ 'aafp.org,americanheart.org,apa.org,cancer.org,cancercenter.com,caremark.com,clevelandclinic.org,diabetesfree.org,drugs.com,emedicinehealth.com,express-scripts.com,familydoctor.org,goodrx.com,healthcaremagic.com,healthfinder.gov,healthline.com,ieee.org,intelihealth.com,labcorp.com,livecellresearch.com,mayoclinic.com,mayoclinic.org,md.com,medcohealth.com,medhelp.org,medicalnewstoday.com,medicare.gov,medicaresupplement.com,medicinenet.com,medscape.com,memorialhermann.org,merckmanuals.com,patient.co.uk,psychcentral.com,psychology.org,psychologytoday.com,rightdiagnosis.com,rxlist.com,socialpsychology.org,spine-health.com,who.int',
|
||||
'health & wellness' ],
|
||||
[ 'aaa.com,aig.com,allianz-assistance.com,allstate.com,allstateagencies.com,amfam.com,amica.com,autoquotesdirect.com,esurance.com,farmers.com,farmersagent.com,geico.com,general-car-insurance-quotes.net,insurance.com,libertymutual.com,libertymutualgroup.com,mercuryinsurance.com,nationwide.com,progressive.com,progressiveagent.com,progressiveinsurance.com,provide-insurance.com,safeco.com,statefarm.com,thehartford.com,travelers.com,usaa.com',
|
||||
'insurance' ],
|
||||
[ '101cookbooks.com,allrecipes.com,bettycrocker.com,bonappetit.com,chocolateandzucchini.com,chow.com,chowhound.chow.com,cookinglight.com,cooks.com,cooksillustrated.com,cooksrecipes.com,delish.com,eater.com,eatingwell.com,epicurious.com,food.com,foodandwine.com,foodgawker.com,foodnetwork.com,gourmet.com,grouprecipes.com,homemaderecipes.co,iheartnaptime.net,kraftfoods.com,kraftrecipes.com,myrecipes.com,opentable.com,pillsbury.com,recipe.com,recipesource.com,recipezaar.com,saveur.com,seriouseats.com,simplyrecipes.com,smittenkitchen.com,southernliving.com,supercook.com,tasteofhome.com,tastespotting.com,technicpack.net,thekitchn.com,urbanspoon.com,wonderhowto.com,yelp.com,yummly.com,zagat.com',
|
||||
'food & lifestyle' ],
|
||||
[ 'aarp.org,allure.com,bustle.com,cosmopolitan.com,diply.com,eharmony.com,elle.com,glamour.com,grandascent.com,harpersbazaar.com,hellogiggles.com,instructables.com,instyle.com,marieclaire.com,match.com,mindbodygreen.com,nymag.com,okcupid.com,petco.com,photobucket.com,pof.com,rantlifestyle.com,redbookmag.com,reddit.com,sheknows.com,style.com,stylebistro.com,theilovedogssite.com,theknot.com,thescene.com,thrillist.com,vogue.com,womansday.com,youngcons.com,yourdictionary.com',
|
||||
'lifestyle' ],
|
||||
[ 'apartmentratings.com,apartmenttherapy.com,architectmagazine.com,architecturaldigest.com,askthebuilder.com,bhg.com,bobvila.com,countryhome.com,countryliving.com,davesgarden.com,decor8blog.com,decorpad.com,diycozyhome.com,diyideas.com,diynetwork.com,doityourself.com,domainehome.com,dwell.com,elledecor.com,familyhandyman.com,frontdoor.com,gardenguides.com,gardenweb.com,getdecorating.com,goodhousekeeping.com,hgtv.com,hgtvgardens.com,hobbylobby.com,homeadvisor.com,homerepair.about.com,hometalk.com,hometime.com,hometips.com,housebeautiful.com,houzz.com,inhabitat.com,lonny.com,makingitlovely.com,marthastewart.com,michaels.com,myhomeideas.com,realsimple.com,remodelista.com,shanty-2-chic.com,styleathome.com,thehandmadehome.net,thehealthyhomeeconomist.com,thisoldhouse.com,traditionalhome.com,trulia.com,younghouselove.com',
|
||||
'home & lifestyle' ],
|
||||
[ '10best.com,10tv.com,11alive.com,19actionnews.com,9news.com,abcnews.com,abcnews.go.com,adweek.com,ajc.com,anchorfree.us,arcamax.com,austin360.com,azcentral.com,bbc.co.uk,boston.com,bostonglobe.com,capecodonline.com,cbsnews.com,cheatsheet.com,chicagotribune.com,chron.com,citylab.com,cnn.com,csmonitor.com,dailyitem.com,dailymail.co.uk,dallasnews.com,eleconomista.es,examiner.com,fastcolabs.com,fivethirtyeight.com,foursquare.com,foxcarolina.com,foxnews.com,globalnews.ca,greatergood.com,guardian.co.uk,historynet.com,huffingtonpost.co.uk,huffingtonpost.com,ijreview.com,independent.co.uk,journal-news.com,kare11.com,kcra.com,kctv5.com,kgw.com,khou.com,king5.com,kirotv.com,kitv.com,kmbc.com,knoxnews.com,kpho.com,kptv.com,kron4.com,ksdk.com,ksl.com,ktvb.com,kvue.com,kxan.com,latimes.com,lifehack.org,littlethings.com,mailtribune.com,mic.com,mirror.co.uk,msn.com,msnbc.com,msnbc.msn.com,myfoxboston.com,nbcnews.com,nbcnewyork.com,newburyportnews.com,news.bbc.co.uk,news.yahoo.com,news12.com,newschannel10.com,newsday.com,newser.com,newsmax.com,newyorker.com,nj.com,nj1015.com,npr.org,nydailynews.com,nypost.com,nytimes.com,palmbeachpost.com,patch.com,philly.com,phys.org,poconorecord.com,prnewswire.com,rare.us,realclearworld.com,record-eagle.com,richmond.com,rt.com,salemnews.com,salon.com,sfgate.com,slate.com,statesman.com,suntimes.com,takepart.com,telegraph.co.uk,theatlantic.com,thedailystar.com,theguardian.com,theroot.com,theverge.com,time.com,timesonline.co.uk,topix.com,usatoday.com,usatoday30.usatoday.com,usnews.com,vice.com,vox.com,wane.com,washingtonpost.com,washingtontimes.com,wave3.com,wavy.com,wbaltv.com,wbir.com,wcnc.com,wdbj7.com,westernjournalism.com,wfaa.com,wfsb.com,wftv.com,wgal.com,wishtv.com,wisn.com,wistv.com,wivb.com,wkyc.com,wlwt.com,wmur.com,woodtv.com,wpxi.com,wsbtv.com,wsfa.com,wsmv.com,wsoctv.com,wthr.com,wtnh.com,wtsp.com,wwltv.com,wyff4.com,wzzm13.com',
|
||||
'news' ],
|
||||
[ 'aei.org,breitbart.com,conservativetalknow.com,conservativetribune.com,dailykos.com,ddo.com,drudgereport.com,dscc.org,foreignpolicy.com,franklinprosperityreport.com,freedomworks.org,macleans.ca,mediamatters.org,militarytimes.com,nationaljournal.com,nationalreview.com,politicalwire.com,politico.com,pressrepublican.com,qpolitical.com,realclearpolitics.com,talkingpointsmemo.com,thehill.com,thenation.com,thinkprogress.org,tnr.com,worldoftanks.eu',
|
||||
'news' ],
|
||||
[ 'americanscientist.org,discovermagazine.com,iflscience.com,livescience.com,nasa.gov,nationalgeographic.com,nature.com,newscientist.com,popsci.com,sciencedaily.com,sciencemag.org,sciencenews.org,scientificamerican.com,space.com,zmescience.com',
|
||||
'science' ],
|
||||
[ 'accuweather.com,intellicast.com,noaa.gov,ssa.gov,theweathernetwork.com,weather.com,weather.gov,weather.yahoo.com,weatherbug.com,weatherunderground.com,weatherzone.com.au,wunderground.com,www.weather.com',
|
||||
'weather' ],
|
||||
[ 'bhphotovideo.com,bigfolio.com,bigstockphoto.com,cameralabs.com,canonrumors.com,canstockphoto.com,digitalcamerareview.com,dpreview.com,expertphotography.com,gettyimages.com,icp.org,imaging-resource.com,intothedarkroom.com,istockphoto.com,nikonusa.com,photos.com,shutterstock.com,slrgear.com,the-digital-picture.com,thephotoargus.com,usa.canon.com,whatdigitalcamera.com,zenfolio.com',
|
||||
'photography' ],
|
||||
[ 'abercrombie.com,ae.com,aeropostale.com,anthropologie.com,bananarepublic.com,buycostumes.com,chadwicks.com,express.com,forever21.com,freepeople.com,hm.com,hollisterco.com,jcrew.com,jessicalondon.com,kingsizemen.com,lordandtaylor.com,lulus.com,metrostyle.com,nomorerack.com,oldnavy.com,oldnavy.gap.com,polyvore.com,rackroomshoes.com,ralphlauren.com,refinery29.com,roamans.com,sammydress.com,shop.nordstrom.com,shopbop.com,topshop.com,urbanoutfitters.com,victoriassecret.com,wetseal.com,womanwithin.com',
|
||||
'shopping' ],
|
||||
[ 'bizrate.com,compare99.com,coupons.com,dealtime.com,epinions.com,junglee.com,kijiji.ca,pricegrabber.com,pronto.com,redplum.com,retailmenot.com,shopping.com,shopzilla.com,smarter.com,valpak.com',
|
||||
'shopping' ],
|
||||
[ '123greetings.com,1800baskets.com,1800flowers.com,americangreetings.com,birthdayexpress.com,bluemountain.com,e-cards.com,egreetings.com,florists.com,ftd.com,gifts.com,groupcard.com,harryanddavid.com,hipstercards.com,kabloom.com,personalcreations.com,proflowers.com,redenvelope.com,someecards.com',
|
||||
'flowers & gifts' ],
|
||||
[ '6pm.com,alibaba.com,aliexpress.com,amazon.co.uk,amazon.com,asos.com,bathandbodyworks.com,bloomingdales.com,bradsdeals.com,buy.com,cafepress.com,circuitcity.com,clarkhoward.com,consumeraffairs.com,costco.com,cvs.com,dhgate.com,diapers.com,dillards.com,ebates.com,ebay.com,ebaystores.com,etsy.com,fingerhut.com,groupon.com,hsn.com,jcpenney.com,kmart.com,kohls.com,kroger.com,lowes.com,macys.com,menards.com,nextag.com,nordstrom.com,orientaltrading.com,overstock.com,qvc.com,racked.com,rewardsnetwork.com,samsclub.com,sears.com,sephora.com,shopathome.com,shopify.com,shopstyle.com,slickdeals.net,soap.com,staples.com,target.com,toptenreviews.com,vistaprint.com,walgreens.com,walmart.ca,walmart.com,wayfair.com,zappos.com,zazzle.com,zulily.com',
|
||||
'shopping' ],
|
||||
[ 'acehardware.com,ashleyfurniture.com,bedbathandbeyond.com,brylanehome.com,casa.com,cb2.com,crateandbarrel.com,dwr.com,ethanallen.com,furniture.com,harborfreight.com,hayneedle.com,homedecorators.com,homedepot.com,ikea.com,info.ikea-usa.com,landofnod.com,pier1.com,plowhearth.com,potterybarn.com,restorationhardware.com,roomandboard.com,westelm.com,williams-sonoma.com',
|
||||
'home shopping' ],
|
||||
[ 'alexandermcqueen.com,bergdorfgoodman.com,bottegaveneta.com,burberry-bluelabel.com,burberry.com,chanel.com,christianlouboutin.com,coach.com,diesel.com,dior.com,dolcegabbana.com,dolcegabbana.it,fendi.com,ferragamo.com,giorgioarmani.com,givenchy.com,gucci.com,guess.com,hermes.com,jeanpaulgaultier.com,jimmychoo.com,juicycouture.com,katespade.com,louisvuitton.com,manoloblahnik.com,marcjacobs.com,neimanmarcus.com,net-a-porter.com,paulsmith.co.uk,prada.com,robertocavalli.com,saksfifthavenue.com,toryburch.com,valentino.com,versace.com,vuitton.com,ysl.com,yslbeautyus.com',
|
||||
'luxury shopping' ],
|
||||
[ 'bargainseatsonline.com,livenation.com,stubhub.com,ticketfly.com,ticketliquidator.com,ticketmaster.com,tickets.com,ticketsnow.com,ticketweb.com,vividseats.com',
|
||||
'events & tickets' ],
|
||||
[ 'babiesrus.com,brothers-brick.com,etoys.com,fao.com,fisher-price.com,hasbro.com,hasbrotoyshop.com,lego.com,legoland.com,mattel.com,toys.com,toysrus.com,toystogrowon.com,toywiz.com',
|
||||
'toys & games' ],
|
||||
[ 'challengegames.nfl.com,fantasy.nfl.com,fantasyfootballblog.net,fantasyfootballcafe.com,fantasyfootballnerd.com,fantasysmarts.com,fftoday.com,fftoolbox.com,football.fantasysports.yahoo.com,footballsfuture.com,mrfootball.com,officefootballpool.com,thehuddle.com',
|
||||
'fantasy football' ],
|
||||
[ 'dailyjoust.com,draftday.com,draftking.com,draftkings.com,draftstreet.com,fanduel.com,realmoneyfantasyleagues.com,thedailyaudible.com',
|
||||
'fantasy sports' ],
|
||||
[ 'cdmsports.com,fanball.com,fantasyguru.com,fantasynews.cbssports.com,fantasyquestions.com,fantasyrundown.com,fantasysharks.com,fantasysports.yahoo.com,fantazzle.com,fantrax.com,fleaflicker.com,junkyardjake.com,kffl.com,mockdraftcentral.com,myfantasyleague.com,rototimes.com,rotowire.com,rotoworld.com,rtsports.com,whatifsports.com',
|
||||
'fantasy sports' ],
|
||||
[ 'football.about.com,football.com,footballoutsiders.com,nationalfootballpost.com,nflalumni.org,nflpa.com,nfltraderumors.co,profootballhof.com,profootballtalk.com,profootballtalk.nbcsports.com,profootballweekly.com',
|
||||
'football' ],
|
||||
[ '49ers.com,atlantafalcons.com,azcardinals.com,baltimoreravens.com,bengals.com,buccaneers.com,buffalobills.com,chargers.com,chicagobears.com,clevelandbrowns.com,colts.com,dallascowboys.com,denverbroncos.com,detroitlions.com,giants.com,houstontexans.com,jaguars.com,kcchiefs.com,miamidolphins.com,neworleanssaints.com,newyorkjets.com,packers.com,panthers.com,patriots.com,philadelphiaeagles.com,raiders.com,redskins.com,seahawks.com,steelers.com,stlouisrams.com,titansonline.com,vikings.com',
|
||||
'football' ],
|
||||
[ 'baseball-reference.com,baseballamerica.com,europeantour.com,golf.com,golfdigest.com,lpga.com,milb.com,minorleagueball.com,mlb.com,mlb.mlb.com,nascar.com,nba.com,ncaa.com,nhl.com,pga.com,pgatour.com,prowrestling.com,surfermag.com,surfline.com,surfshot.com,thehockeynews.com,tsn.com,ufc.com,worldgolfchampionships.com,wwe.com',
|
||||
'sports' ],
|
||||
[ '247sports.com,active.com,armslist.com,basketball-reference.com,bigten.org,bleacherreport.com,bleedinggreennation.com,bloodyelbow.com,cagesideseats.com,cbssports.com,cinesport.com,collegespun.com,cricbuzz.com,crictime.com,csnphilly.com,csnwashington.com,cstv.com,eastbay.com,espn.com,espn.go.com,espncricinfo.com,espnfc.com,espnfc.us,espnradio.com,eteamz.com,fanatics.com,fansided.com,fbschedules.com,fieldandstream.com,flightclub.com,foxsports.com,givemesport.com,goduke.com,goheels.com,golfchannel.com,golfnow.com,grantland.com,grindtv.com,hoopshype.com,icc-cricket.com,imleagues.com,kentuckysportsradio.com,larrybrownsports.com,leaguelineup.com,maxpreps.com,mlbtraderumors.com,mmafighting.com,mmajunkie.com,mmamania.com,msn.foxsports.com,myscore.com,nbcsports.com,nbcsports.msnbc.com,nesn.com,rantsports.com,realclearsports.com,reserveamerica.com,rivals.com,runnersworld.com,sbnation.com,scout.com,sherdog.com,si.com,speedsociety.com,sportingnews.com,sports.yahoo.com,sportsillustrated.cnn.com,sportsmanias.com,sportsmonster.us,sportsonearth.com,stack.com,teamworkonline.com,thebiglead.com,thescore.com,trails.com,triblive.com,upickem.net,usatodayhss.com,watchcric.net,yardbarker.com',
|
||||
'sports news' ],
|
||||
[ 'adidas.com,backcountry.com,backcountrygear.com,cabelas.com,champssports.com,competitivecyclist.com,dickssportinggoods.com,finishline.com,footlocker.com,ladyfootlocker.com,modells.com,motosport.com,mountaingear.com,newbalance.com,nike.com,patagonia.com,puma.com,reebok.com,sportsmansguide.com,steepandcheap.com,tgw.com,thenorthface.com',
|
||||
'sports & outdoor goods' ],
|
||||
[ 'airdroid.com,android-developers.blogspot.com,android.com,androidandme.com,androidapplications.com,androidapps.com,androidauthority.com,androidcommunity.com,androidfilehost.com,androidforums.com,androidguys.com,androidheadlines.com,androidpit.com,androidspin.com,androidtapp.com,androinica.com,droid-life.com,droidforums.net,droidviews.com,droidxforums.com,forum.xda-developers.com,phandroid.com,play.google.com,shopandroid.com,talkandroid.com,theandroidsoul.com,thedroidguy.com,videodroid.org',
|
||||
'technology' ],
|
||||
[ '9to5mac.com,appadvice.com,apple.com,appleinsider.com,appleturns.com,appsafari.com,cultofmac.com,everymac.com,insanelymac.com,iphoneunlockspot.com,isource.com,itunes.apple.com,lowendmac.com,mac-forums.com,macdailynews.com,macenstein.com,macgasm.net,macintouch.com,maclife.com,macnews.com,macnn.com,macobserver.com,macosx.com,macpaw.com,macrumors.com,macsales.com,macstories.net,macupdate.com,macuser.co.uk,macworld.co.uk,macworld.com,maxiapple.com,spymac.com,theapplelounge.com',
|
||||
'technology' ],
|
||||
[ 'adobe.com,asus.com,avast.com,data.com,formstack.com,gboxapp.com,gotomeeting.com,hp.com,htc.com,ibm.com,intel.com,java.com,logme.in,mcafee.com,mcafeesecure.com,microsoftstore.com,norton.com,office.com,office365.com,opera.com,oracle.com,proboards.com,samsung.com,sourceforge.net,squarespace.com,techtarget.com,ultipro.com,uniblue.com,web.com,winzip.com',
|
||||
'technology' ],
|
||||
[ '3dprint.com,4sysops.com,access-programmers.co.uk,accountingweb.com,afterdawn.com,akihabaranews.com,appsrumors.com,avg.com,belkin.com,besttechinfo.com,betanews.com,botcrawl.com,breakingmuscle.com,cheap-phones.com,chip.de,chip.eu,citeworld.com,cleanpcremove.com,commentcamarche.net,computer.org,computerhope.com,computershopper.com,computerweekly.com,contextures.com,coolest-gadgets.com,csoonline.com,daniweb.com,datacenterknowledge.com,ddj.com,devicemag.com,digitaltrends.com,dottech.org,dslreports.com,edugeek.net,eetimes.com,epic.com,eurekalert.org,eweek.com,experts-exchange.com,fosshub.com,freesoftwaremagazine.com,funkyspacemonkey.com,futuremark.com,gadgetreview.com,gizmodo.co.uk,globalsecurity.org,gunup.com,guru3d.com,head-fi.org,hexus.net,hothardware.com,howtoforge.com,idg.com.au,idownloadblog.com,ihackmyi.com,ilounge.com,infomine.com,intellireview.com,intomobile.com,iphonehacks.com,ismashphone.com,it168.com,itechpost.com,itpro.co.uk,jailbreaknation.com,laptoping.com,lightreading.com,malwaretips.com,mediaroom.com,mobilemag.com,modmyi.com,modmymobile.com,mophie.com,mozillazine.org,neoseeker.com,neowin.net,newsoxy.com,nextadvisor.com,notebookcheck.com,notebookreview.com,nvidia.com,orafaq.com,osdir.com,osxdaily.com,our-hometown.com,pchome.net,pconline.com.cn,pcpop.com,pcpro.co.uk,pcreview.co.uk,pcrisk.com,pcwelt.de,phonerebel.com,phonescoop.com,physorg.com,pocket-lint.com,post-theory.com,prnewswire.co.uk,programming4.us,quickpwn.com,redmondpie.com,redorbit.com,safer-networking.org,scientificblogging.com,sciverse.com,servicerow.com,sinfuliphone.com,singularityhub.com,slashgear.com,softonic.com,softonic.com.br,softonic.fr,sophos.com,sparkfun.com,speedguide.net,stuff.tv,symantec.com,taplikahome.com,techdailynews.net,techeblog.com,techie-buzz.com,techniqueworld.com,technobuffalo.com,technologyreview.com,technologytell.com,techpowerup.com,techpp.com,techradar.com,techshout.com,techworld.com,techworld.com.au,techworldtweets.com,telecomfile.com,tgdaily.com,theinquirer.net,thenextweb.com,theregister.co.uk,thermofisher.com,thewindowsclub.com,tomsitpro.com,trustedreviews.com,tuaw.com,tweaktown.com,unwiredview.com,wccftech.com,webmonkey.com,webpronews.com,windows7codecs.com,windowscentral.com,windowsitpro.com,windowstechies.com,winsupersite.com,wired.co.uk,wp-themes.com,xml.com,zol.com.cn',
|
||||
'technology' ],
|
||||
[ 'addons.mozilla.org,air.mozilla.org,blog.mozilla.org,bugzilla.mozilla.org,developer.mozilla.org,etherpad.mozilla.org,forums.mozillazine.org,hacks.mozilla.org,hg.mozilla.org,mozilla.org,planet.mozilla.org,quality.mozilla.org,support.mozilla.org,treeherder.mozilla.org,wiki.mozilla.org',
|
||||
'Mozilla' ],
|
||||
[ '3dprint.com,4sysops.com,access-programmers.co.uk,accountingweb.com,addictivetips.com,adweek.com,afterdawn.com,akihabaranews.com,anandtech.com,appsrumors.com,arstechnica.com,belkin.com,besttechinfo.com,betanews.com,bgr.com,botcrawl.com,breakingmuscle.com,canonrumors.com,cheap-phones.com,chip.de,chip.eu,cio.com,citeworld.com,cleanpcremove.com,cnet.com,commentcamarche.net,computer.org,computerhope.com,computershopper.com,computerweekly.com,contextures.com,coolest-gadgets.com,crn.com,csoonline.com,daniweb.com,data.com,datacenterknowledge.com,ddj.com,devicemag.com,digitaltrends.com,dottech.org,dpreview.com,dslreports.com,edugeek.net,eetimes.com,engadget.com,epic.com,eurekalert.org,eweek.com,experts-exchange.com,extremetech.com,fosshub.com,freesoftwaremagazine.com,funkyspacemonkey.com,futuremark.com,gadgetreview.com,ghacks.net,gizmodo.co.uk,gizmodo.com,globalsecurity.org,greenbot.com,gunup.com,guru3d.com,head-fi.org,hexus.net,hothardware.com,howtoforge.com,idg.com.au,idigitaltimes.com,idownloadblog.com,ihackmyi.com,ilounge.com,infomine.com,informationweek.com,intellireview.com,intomobile.com,iphonehacks.com,ismashphone.com,isource.com,it168.com,itechpost.com,itpro.co.uk,itworld.com,jailbreaknation.com,kioskea.net,laptoping.com,laptopmag.com,lightreading.com,livescience.com,malwaretips.com,mediaroom.com,mobilemag.com,modmyi.com,modmymobile.com,mophie.com,mozillazine.org,neoseeker.com,neowin.net,newscientist.com,newsoxy.com,nextadvisor.com,notebookcheck.com,notebookreview.com,nvidia.com,nwc.com,orafaq.com,osdir.com,osxdaily.com,our-hometown.com,pcadvisor.co.uk,pchome.net,pcmag.com,pconline.com.cn,pcpop.com,pcpro.co.uk,pcreview.co.uk,pcrisk.com,pcwelt.de,phonerebel.com,phonescoop.com,physorg.com,pocket-lint.com,post-theory.com,prnewswire.co.uk,prnewswire.com,programming4.us,quickpwn.com,readwrite.com,redmondpie.com,redorbit.com,reviewed.com,safer-networking.org,sciencedaily.com,sciencenews.org,scientificamerican.com,scientificblogging.com,sciverse.com,servicerow.com,sinfuliphone.com,singularityhub.com,slashdot.org,slashgear.com,softonic.com,softonic.com.br,softonic.fr,sophos.com,space.com,sparkfun.com,speedguide.net,stuff.tv,techdailynews.net,techdirt.com,techeblog.com,techhive.com,techie-buzz.com,technewsworld.com,techniqueworld.com,technobuffalo.com,technologyreview.com,technologytell.com,techpowerup.com,techpp.com,techrepublic.com,techshout.com,techweb.com,techworld.com,techworld.com.au,techworldtweets.com,telecomfile.com,tgdaily.com,theinquirer.net,thenextweb.com,theregister.co.uk,thermofisher.com,theverge.com,thewindowsclub.com,tomsguide.com,tomshardware.com,tomsitpro.com,toptenreviews.com,trustedreviews.com,tuaw.com,tweaktown.com,ubergizmo.com,unwiredview.com,venturebeat.com,wccftech.com,webmonkey.com,webpronews.com,windows7codecs.com,windowscentral.com,windowsitpro.com,windowstechies.com,winsupersite.com,wired.co.uk,wired.com,wp-themes.com,xda-developers.com,xml.com,zdnet.com,zmescience.com,zol.com.cn',
|
||||
'Technology' ],
|
||||
[ '9to5mac.com,appadvice.com,apple.com,appleinsider.com,appleturns.com,appsafari.com,cultofmac.com,everymac.com,insanelymac.com,iphoneunlockspot.com,isource.com,itunes.apple.com,lowendmac.com,mac-forums.com,macdailynews.com,macenstein.com,macgasm.net,macintouch.com,maclife.com,macnews.com,macnn.com,macobserver.com,macosx.com,macpaw.com,macrumors.com,macsales.com,macstories.net,macupdate.com,macuser.co.uk,macworld.co.uk,macworld.com,maxiapple.com,spymac.com,theapplelounge.com',
|
||||
'Technology' ],
|
||||
[ 'alistapart.com,answers.microsoft.com,backpack.openbadges.org,blog.chromium.org,caniuse.com,codefirefox.com,codepen.io,css-tricks.com,css3generator.com,cssdeck.com,csswizardry.com,devdocs.io,docs.angularjs.org,ghacks.net,github.com,html5demos.com,html5rocks.com,html5test.com,iojs.org,khanacademy.org,l10n.mozilla.org,learn.jquery.com,marketplace.firefox.com,mozilla-hispano.org,mozillians.org,news.ycombinator.com,npmjs.com,packagecontrol.io,quirksmode.org,readwrite.com,reps.mozilla.org,smashingmagazine.com,stackoverflow.com,status.modern.ie,teamtreehouse.com,tutorialspoint.com,udacity.com,validator.w3.org,w3.org,w3cschool.cc,w3schools.com,whatcanidoformozilla.org',
|
||||
'Web Development' ],
|
||||
[ 'classroom.google.com,codecademy.com,elearning.ut.ac.id,khanacademy.org,learn.jquery.com,teamtreehouse.com,tutorialspoint.com,udacity.com,w3cschool.cc,w3schools.com',
|
||||
'Web Education' ],
|
||||
[ 'abebooks.co.uk,abebooks.com,alibris.com,allaboutcircuits.com,allyoucanbooks.com,answersingenesis.org,artnet.com,audiobooks.com,barnesandnoble.com,barnesandnobleinc.com,bartleby.com,betterworldbooks.com,biggerbooks.com,bncollege.com,bookbyte.com,bookdepository.com,bookfinder.com,bookrenter.com,booksamillion.com,booksite.com,boundless.com,brookstone.com,btol.com,calibre-ebook.com,campusbookrentals.com,casadellibro.com,cbomc.com,cengagebrain.com,chapters.indigo.ca,christianbook.com,ciscopress.com,coursesmart.com,cqpress.com,crafterschoice.com,crossings.com,cshlp.org,deseretbook.com,directtextbook.com,discountmags.com,doubledaybookclub.com,doubledaylargeprint.com,doverpublications.com,ebooks.com,ecampus.com,fellabooks.net,fictionwise.com,flatworldknowledge.com,grolier.com,harpercollins.com,hayhouse.com,historybookclub.com,hpb.com,hpbmarketplace.com,interweave.com,iseeme.com,katiekazoo.com,knetbooks.com,learnoutloud.com,librarything.com,literaryguild.com,lulu.com,lww.com,macmillan.com,magazines.com,mbsdirect.net,militarybookclub.com,mypearsonstore.com,mysteryguild.com,netplaces.com,noble.com,novelguide.com,onespirit.com,oxfordjournals.org,paperbackswap.com,papy.co.jp,peachpit.com,penguin.com,penguingroup.com,pimsleur.com,powells.com,qpb.com,quepublishing.com,reviews.com,rhapsodybookclub.com,rodalestore.com,royalsocietypublishing.org,sagepub.com,scrubsmag.com,sfbc.com,simonandschuster.com,simonandschuster.net,simpletruths.com,teach12.net,textbooks.com,textbookx.com,thegoodcook.com,thriftbooks.com,tlsbooks.com,toshibabookplace.com,tumblebooks.com,urbookdownload.com,valorebooks.com,valuemags.com,wwnorton.com,zoobooks.com',
|
||||
'Literature' ],
|
||||
[ 'aceshowbiz.com,aintitcoolnews.com,askkissy.com,askmen.com,atraf.co.il,audioboom.com,beamly.com,blippitt.com,bollywoodlife.com,bossip.com,buzzlamp.com,celebdirtylaundry.com,celebfocus.com,celebitchy.com,celebrity-gossip.net,celebrityabout.com,celebwild.com,chisms.net,concertboom.com,crushable.com,cultbox.co.uk,dailyentertainmentnews.com,dayscafe.com,deadline.com,deathandtaxesmag.com,diaryofahollywoodstreetking.com,digitalspy.com,egotastic.com,empirenews.net,enelbrasero.com,everydaycelebs.com,ew.com,extratv.com,facade.com,fanaru.com,fhm.com,geektyrant.com,glamourpage.com,heatworld.com,hlntv.com,hollyscoop.com,hollywoodreporter.com,hollywoodtuna.com,hypable.com,infotransfer.net,insideedition.com,interaksyon.com,jezebel.com,justjared.com,justjaredjr.com,komando.com,koreaboo.com,maxgo.com,maxim.com,maxviral.com,mediatakeout.com,mosthappy.com,moviestalk.com,my.ology.com,ngoisao.net,nofilmschool.com,nolocreo.com,octane.tv,ouchpress.com,people.com,peopleenespanol.com,perezhilton.com,pinkisthenewblog.com,platotv.tv,playbill.com,playbillvault.com,playgroundmag.net,popeater.com,popnhop.com,popsugar.co.uk,popsugar.com,purepeople.com,radaronline.com,rantchic.com,reshareworthy.com,rinkworks.com,ripbird.com,sara-freder.com,screenjunkies.com,soapcentral.com,soapoperadigest.com,sobadsogood.com,splitsider.com,starcasm.net,starpulse.com,straightfromthea.com,stupidcelebrities.net,stupiddope.com,tbn.org,theawesomedaily.com,theawl.com,thefrisky.com,thefw.com,theresacaputo.com,thezooom.com,tvnotas.com.mx,twanatells.com,vanswarpedtour.com,vietgiaitri.com,viral.buzz,vulture.com,wakavision.com,worthytales.net,wwtdd.com,younghollywood.com',
|
||||
'Entertainment News' ],
|
||||
[ '247wallst.com,4-traders.com,advfn.com,agweb.com,allbusiness.com,barchart.com,barrons.com,beckershospitalreview.com,benzinga.com,bizjournals.com,bizsugar.com,bloomberg.com,bloomberglaw.com,business-standard.com,businessinsider.com,businessinsider.com.au,businesspundit.com,businessweek.com,businesswire.com,cboe.com,cheatsheet.com,chicagobusiness.com,cjonline.com,cnbc.com,cnnmoney.com,cqrcengage.com,dailyfinance.com,dailyfx.com,dealbreaker.com,djindexes.com,dowjones.com,easierstreetdaily.com,economist.com,economyandmarkets.com,economywatch.com,edweek.org,eleconomista.es,entrepreneur.com,etfdailynews.com,etfdb.com,ewallstreeter.com,fastcolabs.com,fastcompany.com,financeformulas.net,financialpost.com,flife.de,forbes.com,forexpros.com,fortune.com,foxbusiness.com,ft.com,ftpress.com,fx-exchange.com,hbr.org,howdofinance.com,ibtimes.com,inc.com,investopedia.com,investors.com,investorwords.com,journalofaccountancy.com,kiplinger.com,lendingandcredit.net,lfb.org,mainstreet.com,markettraders.com,marketwatch.com,maxkeiser.com,minyanville.com,ml.com,moneycontrol.com,moneymappress.com,moneynews.com,moneysavingexpert.com,morningstar.com,mortgagenewsdaily.com,motleyfool.com,mt.co.kr,nber.org,nyse.com,oilprice.com,pewsocialtrends.org,principal.com,qz.com,rantfinance.com,realclearmarkets.com,recode.net,reuters.ca,reuters.co.in,reuters.co.uk,reuters.com,rttnews.com,seekingalpha.com,smallbiztrends.com,streetinsider.com,thecheapinvestor.com,theeconomiccollapseblog.com,themoneyconverter.com,thestreet.com,tickertech.com,tradingeconomics.com,updown.com,valuewalk.com,wikinvest.com,wsj.com,zacks.com',
|
||||
'Financial News' ],
|
||||
[ '10tv.com,8newsnow.com,9news.com,abc.net.au,abc7.com,abc7chicago.com,abcnews.go.com,aclu.org,activistpost.com,ajc.com,al.com,alan.com,alarab.net,aljazeera.com,americanthinker.com,app.com,aristeguinoticias.com,azcentral.com,baltimoresun.com,becomingminimalist.com,beforeitsnews.com,bigstory.ap.org,blackamericaweb.com,bloomberg.com,bloombergview.com,boston.com,bostonherald.com,breitbart.com,buffalonews.com,c-span.org,canada.com,cbs46.com,cbsnews.com,chicagotribune.com,chron.com,citizensvoice.com,citylab.com,cleveland.com,cnn.com,coed.com,countercurrentnews.com,courant.com,ctvnews.ca,dailyherald.com,dailynews.com,dallasnews.com,delawareonline.com,democratandchronicle.com,democraticunderground.com,democrats.org,denverpost.com,desmoinesregister.com,dispatch.com,elcomercio.pe,english.aljazeera.net,examiner.com,farsnews.com,firstcoastnews.com,firstpost.com,firsttoknow.com,foreignpolicy.com,foxnews.com,freebeacon.com,freep.com,fresnobee.com,gazette.com,global.nytimes.com,heraldtribune.com,hindustantimes.com,hngn.com,humanevents.com,huzlers.com,indiatimes.com,indystar.com,irishtimes.com,jacksonville.com,jpost.com,jsonline.com,kansascity.com,kctv5.com,kentucky.com,kickerdaily.com,king5.com,kmov.com,knoxnews.com,kpho.com,kvue.com,kwqc.com,kxan.com,lainformacion.com,latimes.com,ldnews.com,lex18.com,linternaute.com,livemint.com,lostateminor.com,m24.ru,macleans.ca,manchestereveningnews.co.uk,marinecorpstimes.com,masslive.com,mavikocaeli.com.tr,mcall.com,medium.com,mentalfloss.com,mercurynews.com,metro.us,miamiherald.com,militarytimes.com,mk.ru,mlive.com,mondotimes.com,montrealgazette.com,msnbc.com,msnewsnow.com,mynews13.com,mysanantonio.com,mysuncoast.com,nbclosangeles.com,nbcnewyork.com,nbcphiladelphia.com,ndtv.com,newindianexpress.com,news.cincinnati.com,news.google.com,news.msn.com,news.yahoo.com,news10.net,news8000.com,newsday.com,newsdaymarketing.net,newsen.com,newsmax.com,newsobserver.com,newsok.com,newsru.ua,newstatesman.com,newszoom.com,nj.com,nola.com,northjersey.com,nouvelobs.com,npr.org,nwfdailynews.com,nwitimes.com,nydailynews.com,nytimes.com,observer.com,ocregister.com,okcfox.com,omaha.com,onenewspage.com,ontheissues.org,oregonlive.com,orlandosentinel.com,palmbeachpost.com,pe.com,pennlive.com,philly.com,pilotonline.com,polar.com,post-gazette.com,postandcourier.com,presstelegram.com,presstv.ir,propublica.org,providencejournal.com,realclearpolitics.com,recorderonline.com,reporterdock.com,reporterherald.com,respublica.al,reuters.com,rg.ru,roanoke.com,sacbee.com,scmp.com,scnow.com,sdpnoticias.com,seattletimes.com,semana.com,sfgate.com,sharepowered.com,sinembargo.mx,slate.com,sltrib.com,sotomayortv.com,sourcewatch.org,spectator.co.uk,squaremirror.com,star-telegram.com,staradvertiser.com,startribune.com,statesman.com,stltoday.com,streetwise.co,stuff.co.nz,success.com,suffolknewsherald.com,sun-sentinel.com,sunnewsnetwork.ca,suntimes.com,supernewschannel.com,surenews.com,svoboda.org,syracuse.com,tampabay.com,tbd.com,telegram.com,telegraph.co.uk,tennessean.com,the-open-mind.com,theadvocate.com,theage.com.au,theatlantic.com,thebarefootwriter.com,theblaze.com,thecalifornian.com,thedailysheeple.com,thefix.com,theintelligencer.net,thelocal.com,thenational.ae,thenewstribune.com,theparisreview.org,thereporter.com,therepublic.com,thestar.com,thetelegram.com,thetimes.co.uk,theuspatriot.com,time.com,timescall.com,timesdispatch.com,timesleaderonline.com,timesofisrael.com,toledoblade.com,toprightnews.com,townhall.com,tpnn.com,trendolizer.com,triblive.com,tribune.com.pk,tricities.com,troymessenger.com,trueactivist.com,truthandaction.org,tsn.ua,tulsaworld.com,twincities.com,upi.com,usatoday.com,utsandiego.com,vagazette.com,viralwomen.com,vitalworldnews.com,voasomali.com,vox.com,washingtonexaminer.com,washingtonpost.com,watchdog.org,wave3.com,wavy.com,wbay.com,wbtw.com,wcpo.com,wctrib.com,wdtn.com,weeklystandard.com,westernjournalism.com,wfsb.com,wgrz.com,whas11.com,winonadailynews.com,wishtv.com,wistv.com,wkbn.com,wkow.com,wlfi.com,wmtw.com,wmur.com,wopular.com,world-top-news.com,worldnews.com,wplol.us,wpsdlocal6.com,wptz.com,wric.com,wsmv.com,wthitv.com,wthr.com,wtnh.com,wtol.com,wtsp.com,wvec.com,wwlp.com,wwltv.com,wyff4.com,yonhapnews.co.kr,yourbreakingnews.com',
|
||||
'News' ],
|
||||
[ '2k.com,360game.vn,4399.com,a10.com,activision.com,addictinggames.com,alawar.com,alienwarearena.com,anagrammer.com,andkon.com,aq.com,arcadeprehacks.com,arcadeyum.com,arcgames.com,archeagegame.com,armorgames.com,askmrrobot.com,battle.net,battlefieldheroes.com,bigfishgames.com,bigpoint.com,bioware.com,bluesnews.com,boardgamegeek.com,bollyheaven.com,bubblebox.com,bukkit.org,bungie.net,buycraft.net,callofduty.com,candystand.com,cda.pl,challonge.com,championselect.net,cheapassgamer.com,cheatcc.com,cheatengine.org,cheathappens.com,chess.com,civfanatics.com,clashofclans-tools.com,clashofclansbuilder.com,comdotgame.com,commonsensemedia.org,coolrom.com,crazygames.com,csgolounge.com,curse.com,d20pfsrd.com,destructoid.com,diablofans.com,diablowiki.net,didigames.com,dota2.com,dota2lounge.com,dressupgames.com,dulfy.net,ebog.com,elderscrollsonline.com,elitedangerous.com,elitepvpers.com,emuparadise.me,enjoydressup.com,escapegames24.com,escapistmagazine.com,eventhubs.com,eveonline.com,farming-simulator.com,feed-the-beast.com,flashgames247.com,flightrising.com,flipline.com,flonga.com,freegames.ws,freeonlinegames.com,fresh-hotel.org,friv.com,friv.today,fullypcgames.net,funny-games.biz,funtrivia.com,futhead.com,g2a.com,gamasutra.com,game-debate.com,game-oldies.com,game321.com,gamebaby.com,gamebaby.net,gamebanana.com,gamefaqs.com,gamefly.com,gamefront.com,gamegape.com,gamehouse.com,gameinformer.com,gamejolt.com,gamemazing.com,gamemeteor.com,gamerankings.com,gamersgate.com,games-msn.com,games-workshop.com,games.com,games2girls.com,gamesbox.com,gamesfreak.net,gametop.com,gametracker.com,gametrailers.com,gamezhero.com,gbatemp.net,geforce.com,gematsu.com,giantbomb.com,girl.me,girlsgames123.com,girlsplay.com,gog.com,gogames.me,gonintendo.com,goodgamestudios.com,gosugamers.net,greenmangaming.com,gtaforums.com,gtainside.com,guildwars2.com,hackedarcadegames.com,hearthpwn.com,hirezstudios.com,hitbox.tv,hltv.org,howrse.com,icy-veins.com,indiedb.com,jayisgames.com,jigzone.com,joystiq.com,juegosdechicas.com,kabam.com,kbhgames.com,kerbalspaceprogram.com,king.com,kixeye.com,kizi.com,kogama.com,kongregate.com,kotaku.com,lolcounter.com,lolking.net,lolnexus.com,lolpro.com,lolskill.net,lootcrate.com,lumosity.com,mafa.com,mangafox.me,mangapark.com,mariowiki.com,maxgames.com,megagames.com,metacritic.com,mindjolt.com,minecraft.net,minecraftforum.net,minecraftservers.org,minecraftskins.com,mineplex.com,miniclip.com,mmo-champion.com,mmobomb.com,mmohuts.com,mmorpg.com,mmosite.com,mobafire.com,moddb.com,modxvm.com,mojang.com,moshimonsters.com,mousebreaker.com,moviestarplanet.com,mtgsalvation.com,muchgames.com,myonlinearcade.com,myplaycity.com,myrealgames.com,mythicspoiler.com,n4g.com,newgrounds.com,nexon.net,nexusmods.com,ninjakiwi.com,nintendo.com,nintendoeverything.com,nintendolife.com,nitrome.com,nosteam.ro,notdoppler.com,noxxic.com,operationsports.com,origin.com,ownedcore.com,pacogames.com,pathofexile.com,pcgamer.com,pch.com,pcsx2.net,penny-arcade.com,planetminecraft.com,plarium.com,playdota.com,playpink.com,playsides.com,playstationlifestyle.net,playstationtrophies.org,pog.com,pokemon.com,polygon.com,popcap.com,primarygames.com,probuilds.net,ps3hax.net,psnprofiles.com,psu.com,qq.com,r2games.com,resourcepack.net,retrogamer.com,rewardtv.com,riotgames.com,robertsspaceindustries.com,roblox.com,robocraftgame.com,rockpapershotgun.com,rockstargames.com,roosterteeth.com,runescape.com,schoolofdragons.com,screwattack.com,scufgaming.com,segmentnext.com,shacknews.com,shockwave.com,shoryuken.com,siliconera.com,silvergames.com,skydaz.com,smashbros.com,solomid.net,starcitygames.com,starsue.net,steamcommunity.com,steamgifts.com,strategywiki.org,supercheats.com,surrenderat20.net,swtor.com,tankionline.com,tcgplayer.com,teamfortress.com,teamliquid.net,tetrisfriends.com,thesims3.com,thesimsresource.com,thetechgame.com,topg.org,totaljerkface.com,toucharcade.com,transformice.com,trueachievements.com,twcenter.net,twitch.tv,twoplayergames.org,unity3d.com,vg247.com,vgchartz.com,videogamesblogger.com,warframe.com,warlight.net,warthunder.com,watchcartoononline.com,websudoku.com,wildstar-online.com,wildtangent.com,wineverygame.com,wizards.com,worldofsolitaire.com,worldoftanks.com,wowhead.com,wowprogress.com,wowwiki.com,xbox.com,xbox360iso.com,xboxachievements.com,xfire.com,xtremetop100.com,y8.com,yoyogames.com,zybez.net,zynga.com',
|
||||
'Video Game' ],
|
||||
[ 'addictivetips.com,allthingsd.com,anandtech.com,androidcentral.com,androidpolice.com,arstechnica.com,bgr.com,boygeniusreport.com,cio.com,cnet.com,computerworld.com,crn.com,electronista.com,engadget.com,extremetech.com,fastcocreate.com,fastcodesign.com,fastcoexist.com,frontlinek12.com,gigaom.com,gizmag.com,gizmodo.com,greenbot.com,howtogeek.com,idigitaltimes.com,imore.com,informationweek.com,infoworld.com,itworld.com,kioskea.net,laptopmag.com,leadpages.net,lifehacker.com,mashable.com,networkworld.com,news.cnet.com,nwc.com,pastebin.com,pcadvisor.co.uk,pcmag.com,pcworld.com,phonearena.com,reviewed.com,serverfault.com,siteadvisor.com,slashdot.org,techcrunch.com,techdirt.com,techhive.com,technewsworld.com,techrepublic.com,techweb.com,tomsguide.com,tomshardware.com,ubergizmo.com,venturebeat.com,wired.com,xda-developers.com,zdnet.com',
|
||||
'technology news' ],
|
||||
[ 'bestbuy.ca,bestbuy.com,cdw.com,compusa.com,computerlivehelp.co,cyberguys.com,dell.com,digitalinsight.com,directron.com,ebuyer.com,frontierpc.com,frys-electronics-ads.com,frys.com,geeks.com,gyazo.com,homestead.com,lenovo.com,macmall.com,microcenter.com,miniinthebox.com,mwave.com,newegg.com,officedepot.com,outletpc.com,outpost.com,radioshack.com,rakuten.com,tigerdirect.com',
|
||||
'tech retail' ],
|
||||
[ 'chat.com,fring.com,hello.firefox.com,oovoo.com,viber.com',
|
||||
'video chat' ],
|
||||
[ 'alistapart.com,answers.microsoft.com,backpack.openbadges.org,blog.chromium.org,caniuse.com,codefirefox.com,codepen.io,css-tricks.com,css3generator.com,cssdeck.com,csswizardry.com,devdocs.io,docs.angularjs.org,ghacks.net,github.com,html5demos.com,html5rocks.com,html5test.com,iojs.org,l10n.mozilla.org,marketplace.firefox.com,mozilla-hispano.org,mozillians.org,news.ycombinator.com,npmjs.com,packagecontrol.io,quirksmode.org,readwrite.com,reps.mozilla.org,smashingmagazine.com,speckyboy.com,stackoverflow.com,status.modern.ie,validator.w3.org,w3.org,webreference.com,whatcanidoformozilla.org',
|
||||
'web development' ],
|
||||
[ 'classroom.google.com,codeacademy.org,codecademy.com,codeschool.com,codeyear.com,elearning.ut.ac.id,how-to-build-websites.com,htmlcodetutorial.com,htmldog.com,htmlplayground.com,learn.jquery.com,quackit.com,roseindia.net,teamtreehouse.com,tizag.com,tutorialspoint.com,udacity.com,w3schools.com,webdevelopersnotes.com',
|
||||
'webdev education' ],
|
||||
[ 'att.com,att.net,attonlineoffers.com,bell.ca,bellsouth.com,cableone.net,cablevision.com,centurylink.com,centurylink.net,centurylinkquote.com,charter-business.com,charter.com,charter.net,chartercabledeals.com,chartermedia.com,comcast.com,comcast.net,cox.com,cox.net,coxnewsweb.com,directv.com,dish.com,dishnetwork.com,freeconferencecall.com,frontier.com,hughesnet.com,liveitwithcharter.com,mycenturylink.com,mydish.com,net10.com,officialtvstream.com.es,optimum.com,optimum.net,paygonline.com,paytm.com,qwest.com,rcn.com,rebtel.com,ringcentral.com,straighttalkbyop.com,swappa.com,textem.net,timewarner.com,timewarnercable.com,tracfone.com,verizon.com,verizon.net,voipo.com,vonagebusiness.com,wayport.net,whistleout.com,wildblue.net,windstream.net,windstreambusiness.net,wowway.com,ww2.cox.com,xfinity.com',
|
||||
'telecommunication' ],
|
||||
[ 'alltel.com,assurancewireless.com,attsavings.com,boostmobile.com,boostmobilestore.com,budgetmobile.com,consumercellular.com,credomobile.com,gosmartmobile.com,h2owirelessnow.com,lycamobile.com,lycamobile.us,metropcs.com,motorola.com,mycricket.com,myfamilymobile.com,nextel.com,nokia.com,nokiausa.com,polarmobile.com,qlinkwireless.com,republicwireless.com,sprint.com,sprintpcs.com,straighttalk.com,t-mobile.co.uk,t-mobile.com,tmobile.com,tracfonewireless.com,uscellular.com,verizonwireless.com,virginmobile.com,virginmobile.com.au,virginmobileusa.com,vodafone.co.uk,vodafone.com,vodaphone.co.uk,vonange.com,vzwshop.com,wireless.att.com',
|
||||
'mobile carrier' ],
|
||||
[ 'aa.com,aerlingus.com,airasia.com,aircanada.com,airfrance.com,airindia.com,alaskaair.com,alaskaairlines.com,allegiantair.com,britishairways.com,cathaypacific.com,china-airlines.com,continental.com,delta.com,deltavacations.com,dragonair.com,easyjet.com,elal.co.il,emirates.com,flightaware.com,flyfrontier.com,frontierairlines.com,hawaiianair.com,iberia.com,jetairways.com,jetblue.com,klm.com,koreanair.com,kuwait-airways.com,lan.com,lufthansa.com,malaysiaairlines.com,mihinlanka.com,nwa.com,qantas.com.au,qatarairways.com,ryanair.com,singaporeair.com,smartfares.com,southwest.com,southwestvacations.com,spiritair.com,spiritairlines.com,thaiair.com,united.com,usairways.com,virgin-atlantic.com,virginamerica.com,virginblue.com.au',
|
||||
'travel & airline' ],
|
||||
[ 'carnival.com,celebrity-cruises.com,celebritycruises.com,costacruise.com,cruise.com,cruiseamerica.com,cruisecritic.com,cruisedirect.com,cruisemates.com,cruises.com,cruisesonly.com,crystalcruises.com,cunard.com,disneycruise.disney.go.com,hollandamerica.com,ncl.com,pocruises.com,princess.com,royalcaribbean.com,royalcaribbean.cruiselines.com,rssc.com,seabourn.com,silversea.com,starcruises.com,vikingrivercruises.com,windstarcruises.com',
|
||||
'travel & cruise' ],
|
||||
[ 'agoda.com,airbnb.com,beaches.com,bedandbreakfast.com,bestwestern.com,booking.com,caesars.com,choicehotels.com,comfortinn.com,daysinn.com,dealbase.com,doubletree3.hilton.com,embassysuites.com,fairmont.com,flipkey.com,fourseasons.com,greatwolf.com,hamptoninn.hilton.com,hamptoninn3.hilton.com,hhonors3.hilton.com,hilton.com,hiltongardeninn3.hilton.com,hiltonworldwide.com,holidayinn.com,homeaway.com,hotelclub.com,hotelopia.com,hotels.com,hotelscombined.com,hyatt.com,ihg.com,laterooms.com,lhw.com,lq.com,mandarinoriental.com,marriott.com,motel6.com,omnihotels.com,radisson.com,ramada.com,rci.com,reservationcounter.com,resortvacationstogo.com,ritzcarlton.com,roomkey.com,sheraton.com,starwoodhotels.com,starwoodhotelshawaii.com,super8.com,thetrain.com,vacationhomerentals.com,vacationrentals.com,vrbo.com,wyndhamrewards.com',
|
||||
'hotel & resort' ],
|
||||
[ 'airfarewatchdog.com,airliners.net,atlanta-airport.com,budgettravel.com,cntraveler.com,cntraveller.com,destination360.com,flightstats.com,flyertalk.com,fodors.com,frommers.com,letsgo.com,lonelyplanet.com,matadornetwork.com,perfectvacation.co,ricksteves.com,roughguides.com,timeout.com,travelalberta.us,travelandleisure.com,travelchannel.com,traveler.nationalgeographic.com,travelmath.com,traveltune.com,tripadvisor.com,vegas.com,viator.com,virtualtourist.com,wikitravel.org,worldtravelguide.net',
|
||||
'travel' ],
|
||||
[ 'aavacations.com,applevacations.com,avianca.com,bookingbuddy.com,bookit.com,cheapair.com,cheapcaribbean.com,cheapflights.com,cheapoair.com,cheaptickets.com,chinahighlights.com,costcotravel.com,ctrip.com,despegar.com,edreams.net,expedia.ca,expedia.com,fareboom.com,farebuzz.com,farecast.live.com,farecompare.com,faregeek.com,flightnetwork.com,funjet.com,golastminute.com,hipmunk.com,hotwire.com,ifly.com,justairticket.com,kayak.com,lastminute.com,lastminutetravel.com,lowestfare.com,lowfares.com,momondo.com,onetime.com,onetravel.com,orbitz.com,otel.com,priceline.com,pricelinevisa.com,sidestep.com,skyscanner.com,smartertravel.com,statravel.com,tigerair.com,travelocity.com,travelonbids.com,travelzoo.com,tripsta.com,trivago.com,universalorlando.com,universalstudioshollywood.com,vacationexpress.com,venere.com,webjet.com,yatra.com',
|
||||
'travel' ],
|
||||
[ 'airportrentalcars.com,alamo.com,amtrak.com,anytransitguide.com,avis.com,boltbus.com,budget.com,carrentalexpress.com,carrentals.com,coachusa.com,dollar.com,e-zrentacar.com,enterprise.com,europcar.com,foxrentacar.com,gotobus.com,greyhound.com,hertz.com,hertzondemand.com,indianrail.gov.in,irctc.co.in,megabus.com,mta.info,nationalcar.com,nationalrail.co.uk,njtransit.com,paylesscar.com,paylesscarrental.com,peterpanbus.com,raileurope.com,rentalcars.com,rideuta.com,stagecoachbus.com,thrifty.com,uber.com,wanderu.com,zipcar.com',
|
||||
'travel & transit' ],
|
||||
[ 'bulbagarden.net,cheatcc.com,cheatmasters.com,cheats.ign.com,comicvine.com,computerandvideogames.com,counter-strike.net,escapistmagazine.com,gamedaily.com,gamefront.com,gameinformer.com,gamerankings.com,gamespot.com,gamesradar.com,gamestop.com,gametrailers.com,gamezone.com,giantbomb.com,ign.com,kotaku.com,metacritic.com,minecraft-server-list.com,minecraftforge.net,minecraftforum.net,minecraftservers.org,minecraftskins.com,mmo-champion.com,mojang.com,pcgamer.com,planetminecraft.com,supercheats.com,thesims.com,totaljerkface.com,unity3d.com,vg247.com,wowhead.com',
|
||||
'gaming' ],
|
||||
[ 'a10.com,absolutist.com,addictinggames.com,aeriagames.com,agame.com,alpha-wars.com,arcadeyum.com,armorgames.com,ballerarcade.com,battle.net,battlefield.com,bigfishgames.com,bioware.com,bitrhymes.com,candystand.com,conjurorthegame.com,crazymonkeygames.com,crusharcade.com,curse.com,cuttherope.net,dreammining.com,dressupgames.com,ea.com,easports.com,fps-pb.com,freearcade.com,freeonlinegames.com,friv.com,funplusgame.com,gamefly.com,gameforge.com,gamehouse.com,gamejolt.com,gameloft.com,gameoapp.com,gamepedia.com,gamersfirst.com,games.com,games.yahoo.com,gamesgames.com,gamezhero.com,gamingwonderland.com,ganymede.eu,goodgamestudios.com,gpotato.com,gsn.com,guildwars2.com,hirezstudios.com,igg.com,iwin.com,kahoot.it,king.com,kizi.com,kongregate.com,leagueoflegends.com,lolking.net,maxgames.com,minecraft-mp.com,minecraft.net,miniclip.com,mmo-play.com,mmorpg.com,mobafire.com,moviestarplanet.com,myonlinearcade.com,needforspeed.com,newgrounds.com,nexusmods.com,nintendo.com,noxxic.com,onrpg.com,origin.com,pch.com,peakgames.net,playstation.com,pogo.com,pokemon.com,popcap.com,primarygames.com,r2games.com,railnation.us,riotgames.com,roblox.com,rockstargames.com,runescape.com,shockwave.com,silvergames.com,spore.com,steamcommunity.com,steampowered.com,stickpage.com,swtor.com,tetrisfriends.com,thegamerstop.com,thesims3.com,twitch.tv,warthunder.com,wildtangent.com,worldoftanks.com,worldofwarcraft.com,worldofwarplanes.com,worldofwarships.com,xbox.com,y8.com,zone.msn.com,zynga.com,zyngawithfriends.com',
|
||||
'online gaming' ],
|
||||
]);
|
||||
|
||||
// Only allow link urls that are http(s)
|
||||
@ -646,6 +790,18 @@ let DirectoryLinksProvider = {
|
||||
return allowed.has(scheme) && (!checkBase || ALLOWED_URL_BASE.has(base));
|
||||
},
|
||||
|
||||
_escapeChars(text) {
|
||||
let charMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
|
||||
return text.replace(/[&<>"']/g, (character) => charMap[character]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the current set of directory links.
|
||||
* @param aCallback The function that the array of links is passed to.
|
||||
@ -678,8 +834,8 @@ let DirectoryLinksProvider = {
|
||||
ParserUtils.SanitizerDropForms |
|
||||
ParserUtils.SanitizerDropNonCSSPresentation;
|
||||
|
||||
link.explanation = link.explanation ? ParserUtils.convertToPlainText(link.explanation, sanitizeFlags, 0) : "";
|
||||
link.targetedName = ParserUtils.convertToPlainText(link.adgroup_name, sanitizeFlags, 0) || name;
|
||||
link.explanation = this._escapeChars(link.explanation ? ParserUtils.convertToPlainText(link.explanation, sanitizeFlags, 0) : "");
|
||||
link.targetedName = this._escapeChars(ParserUtils.convertToPlainText(link.adgroup_name, sanitizeFlags, 0) || name);
|
||||
link.lastVisitDate = rawLinks.suggested.length - position;
|
||||
// check if link wants to avoid inadjacent sites
|
||||
if (link.check_inadjacency) {
|
||||
|
@ -260,6 +260,16 @@ if test -n "$MOZ_NATIVE_DEVICES" ; then
|
||||
AC_SUBST(ANDROID_APPCOMPAT_LIB)
|
||||
AC_SUBST(ANDROID_APPCOMPAT_RES)
|
||||
|
||||
ANDROID_RECYCLERVIEW_LIB="$ANDROID_COMPAT_DIR_BASE/v7/recyclerview/libs/android-support-v7-recyclerview.jar"
|
||||
ANDROID_RECYCLERVIEW_RES="$ANDROID_COMPAT_DIR_BASE/v7/recyclerview/res"
|
||||
AC_MSG_CHECKING([for v7 recyclerview library])
|
||||
if ! test -e $ANDROID_RECYCLERVIEW_LIB ; then
|
||||
AC_MSG_ERROR([You must download the v7 recyclerview Android support library. Run the Android SDK tool and install Android Support Library under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_RECYCLERVIEW_LIB)])
|
||||
fi
|
||||
AC_MSG_RESULT([$ANDROID_RECYCLERVIEW_LIB])
|
||||
AC_SUBST(ANDROID_RECYCLERVIEW_LIB)
|
||||
AC_SUBST(ANDROID_RECYCLERVIEW_RES)
|
||||
|
||||
ANDROID_MEDIAROUTER_LIB="$ANDROID_COMPAT_DIR_BASE/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
|
||||
ANDROID_MEDIAROUTER_RES="$ANDROID_COMPAT_DIR_BASE/v7/mediarouter/res"
|
||||
AC_MSG_CHECKING([for v7 mediarouter library])
|
||||
|
@ -285,8 +285,8 @@ class GarbageCollectionEvent
|
||||
// Represents a single slice of a possibly multi-slice incremental garbage
|
||||
// collection.
|
||||
struct Collection {
|
||||
int64_t startTimestamp;
|
||||
int64_t endTimestamp;
|
||||
double startTimestamp;
|
||||
double endTimestamp;
|
||||
};
|
||||
|
||||
// The set of garbage collection slices that made up this GC cycle.
|
||||
|
@ -931,7 +931,7 @@ Statistics::beginSlice(const ZoneGCStats& zoneStats, JSGCInvocationKind gckind,
|
||||
if (first)
|
||||
beginGC(gckind);
|
||||
|
||||
SliceData data(budget, reason, PRMJ_Now(), GetPageFaultCount());
|
||||
SliceData data(budget, reason, PRMJ_Now(), JS_GetCurrentEmbedderTime(), GetPageFaultCount());
|
||||
if (!slices.append(data)) {
|
||||
// OOM testing fails if we CrashAtUnhandlableOOM here.
|
||||
aborted = true;
|
||||
@ -954,6 +954,7 @@ Statistics::endSlice()
|
||||
{
|
||||
if (!aborted) {
|
||||
slices.back().end = PRMJ_Now();
|
||||
slices.back().endTimestamp = JS_GetCurrentEmbedderTime();
|
||||
slices.back().endFaults = GetPageFaultCount();
|
||||
|
||||
int64_t sliceTime = slices.back().end - slices.back().start;
|
||||
|
@ -211,10 +211,12 @@ struct Statistics
|
||||
static const size_t MAX_NESTING = 20;
|
||||
|
||||
struct SliceData {
|
||||
SliceData(SliceBudget budget, JS::gcreason::Reason reason, int64_t start, size_t startFaults)
|
||||
SliceData(SliceBudget budget, JS::gcreason::Reason reason, int64_t start,
|
||||
double startTimestamp, size_t startFaults)
|
||||
: budget(budget), reason(reason),
|
||||
resetReason(nullptr),
|
||||
start(start), startFaults(startFaults)
|
||||
start(start), startTimestamp(startTimestamp),
|
||||
startFaults(startFaults)
|
||||
{
|
||||
for (auto i : mozilla::MakeRange(NumTimingArrays))
|
||||
mozilla::PodArrayZero(phaseTimes[i]);
|
||||
@ -224,6 +226,7 @@ struct Statistics
|
||||
JS::gcreason::Reason reason;
|
||||
const char* resetReason;
|
||||
int64_t start, end;
|
||||
double startTimestamp, endTimestamp;
|
||||
size_t startFaults, endFaults;
|
||||
PhaseTimeTable phaseTimes;
|
||||
|
||||
|
@ -8056,8 +8056,8 @@ GarbageCollectionEvent::Create(JSRuntime* rt, ::js::gcstats::Statistics& stats,
|
||||
if (!data->collections.growBy(1))
|
||||
return nullptr;
|
||||
|
||||
data->collections.back().startTimestamp = range.front().start;
|
||||
data->collections.back().endTimestamp = range.front().end;
|
||||
data->collections.back().startTimestamp = range.front().startTimestamp;
|
||||
data->collections.back().endTimestamp = range.front().endTimestamp;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,5 +3,6 @@
|
||||
[browser_bug685470.js]
|
||||
[browser_bug703210.js]
|
||||
[browser_bug706743.js]
|
||||
skip-if = (os == 'linux') || e10s # Bug 1157576
|
||||
[browser_bug1163304.js]
|
||||
skip-if = os != 'linux' && os != 'win' // Due to testing menubar behavior with keyboard
|
||||
|
@ -64,6 +64,8 @@ JAVA_BOOTCLASSPATH := \
|
||||
|
||||
JAVA_BOOTCLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_BOOTCLASSPATH)))
|
||||
|
||||
JAVA_CLASSPATH += $(ANDROID_RECYCLERVIEW_LIB)
|
||||
|
||||
# If native devices are enabled, add Google Play Services and some of the v7
|
||||
# compat libraries.
|
||||
ifdef MOZ_NATIVE_DEVICES
|
||||
@ -80,6 +82,7 @@ JAVA_CLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_CLASSPATH)))
|
||||
# into classes.dex.
|
||||
java_bundled_libs := \
|
||||
$(ANDROID_COMPAT_LIB) \
|
||||
$(ANDROID_RECYCLERVIEW_LIB) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_NATIVE_DEVICES
|
||||
@ -369,6 +372,7 @@ generated/org/mozilla/gecko/R.java: .aapt.deps ;
|
||||
# If native devices are enabled, add Google Play Services, build their resources
|
||||
generated/android/support/v7/appcompat/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/mediarouter/R.java: .aapt.deps ;
|
||||
generated/android/support/v7/recyclerview/R.java: .aapt.deps ;
|
||||
generated/com/google/android/gms/R.java: .aapt.deps ;
|
||||
|
||||
ifdef MOZ_NATIVE_DEVICES
|
||||
@ -382,6 +386,9 @@ ifdef MOZ_NATIVE_DEVICES
|
||||
extra_res_dirs += $(GOOGLE_PLAY_SERVICES_RES)
|
||||
endif
|
||||
|
||||
extra_packages += android.support.v7.recyclerview
|
||||
extra_res_dirs += $(ANDROID_RECYCLERVIEW_RES)
|
||||
|
||||
gecko.ap_: .aapt.deps ;
|
||||
R.txt: .aapt.deps ;
|
||||
|
||||
|
@ -44,6 +44,8 @@ if CONFIG['MOZ_NATIVE_DEVICES']:
|
||||
resjar.generated_sources += ['android/support/v7/appcompat/R.java']
|
||||
resjar.generated_sources += ['android/support/v7/mediarouter/R.java']
|
||||
|
||||
resjar.generated_sources += ['android/support/v7/recyclerview/R.java']
|
||||
|
||||
resjar.javac_flags += ['-Xlint:all']
|
||||
|
||||
mgjar = add_java_jar('gecko-mozglue')
|
||||
@ -616,6 +618,7 @@ moz_native_devices_sources = [
|
||||
if CONFIG['MOZ_NATIVE_DEVICES']:
|
||||
gbjar.extra_jars += moz_native_devices_jars
|
||||
gbjar.sources += moz_native_devices_sources
|
||||
gbjar.extra_jars += [CONFIG['ANDROID_RECYCLERVIEW_LIB']]
|
||||
|
||||
gbjar.javac_flags += ['-Xlint:all,-deprecation,-fallthrough', '-J-Xmx512m', '-J-Xms128m']
|
||||
|
||||
|
@ -48,6 +48,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
compile 'com.android.support:support-v4:22.2.0'
|
||||
compile 'com.android.support:recyclerview-v7:22.2.0'
|
||||
|
||||
if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
|
||||
compile 'com.android.support:appcompat-v7:22.2.0'
|
||||
|
@ -99,8 +99,8 @@ skip-if = android_version == "10" || android_version == "18"
|
||||
# disabled on Android 2.3, bug 979600; on 4.3, bug 1145879
|
||||
skip-if = android_version == "10" || android_version == "18"
|
||||
[testSettingsMenuItems.java]
|
||||
# disabled on 4.3, bug 1144898
|
||||
skip-if = android_version == "18"
|
||||
# disabled on Android 2.3, bug 979552; on 4.3, bug 1144898
|
||||
skip-if = android_version == "10" || android_version == "18"
|
||||
# [testShareLink.java] # see bug 915897
|
||||
[testSystemPages.java]
|
||||
# disabled on 2.3, bug 979603; on 4.3, bug 1142811
|
||||
|
@ -144,7 +144,7 @@ public class testSettingsMenuItems extends PixelTest {
|
||||
"The Settings menu did not load", mStringHelper.SETTINGS_LABEL);
|
||||
|
||||
// Dismiss the Settings screen and verify that the view is returned to about:home page
|
||||
mSolo.goBack();
|
||||
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
||||
|
||||
// Waiting for page title to appear to be sure that is fully loaded before opening the menu
|
||||
mAsserter.ok(mSolo.waitForText(mStringHelper.TITLE_PLACE_HOLDER), "about:home did not load",
|
||||
@ -281,7 +281,7 @@ public class testSettingsMenuItems extends PixelTest {
|
||||
mSolo.clickOnText("^Cancel$");
|
||||
} else {
|
||||
// Some submenus aren't dialogs, but are nested screens; exit using "back".
|
||||
mSolo.goBack();
|
||||
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -290,8 +290,10 @@ public class testSettingsMenuItems extends PixelTest {
|
||||
if (mDevice.type.equals("phone")) {
|
||||
int menuDepth = menuPath.length;
|
||||
while (menuDepth > 0) {
|
||||
mSolo.goBack();
|
||||
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
||||
menuDepth--;
|
||||
// Sleep so subsequent back actions aren't lost.
|
||||
mSolo.sleep(150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,12 +111,6 @@ AccountState.prototype = {
|
||||
this.signedInUser = null;
|
||||
this.uid = null;
|
||||
this.fxaInternal = null;
|
||||
this.initProfilePromise = null;
|
||||
|
||||
if (this.profile) {
|
||||
this.profile.tearDown();
|
||||
this.profile = null;
|
||||
}
|
||||
},
|
||||
|
||||
// Clobber all cached data and write that empty data to storage.
|
||||
@ -294,41 +288,6 @@ AccountState.prototype = {
|
||||
return d.promise.then(result => this.resolve(result));
|
||||
},
|
||||
|
||||
// Get the account's profile image URL from the profile server
|
||||
getProfile: function () {
|
||||
return this.initProfile()
|
||||
.then(() => this.profile.getProfile());
|
||||
},
|
||||
|
||||
// Instantiate a FxAccountsProfile with a fresh OAuth token if needed
|
||||
initProfile: function () {
|
||||
|
||||
let profileServerUrl = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.profile.uri");
|
||||
|
||||
let oAuthOptions = {
|
||||
scope: "profile"
|
||||
};
|
||||
|
||||
if (this.initProfilePromise) {
|
||||
return this.initProfilePromise;
|
||||
}
|
||||
|
||||
this.initProfilePromise = this.fxaInternal.getOAuthToken(oAuthOptions)
|
||||
.then(token => {
|
||||
this.profile = new FxAccountsProfile(this, {
|
||||
profileServerUrl: profileServerUrl,
|
||||
token: token
|
||||
});
|
||||
this.initProfilePromise = null;
|
||||
})
|
||||
.then(null, err => {
|
||||
this.initProfilePromise = null;
|
||||
throw err;
|
||||
});
|
||||
|
||||
return this.initProfilePromise;
|
||||
},
|
||||
|
||||
resolve: function(result) {
|
||||
if (!this.isCurrent) {
|
||||
log.info("An accountState promise was resolved, but was actually rejected" +
|
||||
@ -594,6 +553,19 @@ FxAccountsInternal.prototype = {
|
||||
return this._fxAccountsClient;
|
||||
},
|
||||
|
||||
// The profile object used to fetch the actual user profile.
|
||||
_profile: null,
|
||||
get profile() {
|
||||
if (!this._profile) {
|
||||
let profileServerUrl = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.profile.uri");
|
||||
this._profile = new FxAccountsProfile({
|
||||
fxa: this,
|
||||
profileServerUrl: profileServerUrl,
|
||||
});
|
||||
}
|
||||
return this._profile;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the current time in milliseconds as an integer. Allows tests to
|
||||
* manipulate the date to simulate certificate expiration.
|
||||
@ -849,6 +821,10 @@ FxAccountsInternal.prototype = {
|
||||
*/
|
||||
_signOutLocal: function signOutLocal() {
|
||||
let currentAccountState = this.currentAccountState;
|
||||
if (this._profile) {
|
||||
this._profile.tearDown();
|
||||
this._profile = null;
|
||||
}
|
||||
return currentAccountState.signOut().then(() => {
|
||||
this.abortExistingFlow(); // this resets this.currentAccountState.
|
||||
});
|
||||
@ -1430,17 +1406,17 @@ FxAccountsInternal.prototype = {
|
||||
* UNKNOWN_ERROR
|
||||
*/
|
||||
getSignedInUserProfile: function () {
|
||||
let accountState = this.currentAccountState;
|
||||
return accountState.getProfile()
|
||||
.then((profileData) => {
|
||||
let currentState = this.currentAccountState;
|
||||
return this.profile.getProfile().then(
|
||||
profileData => {
|
||||
let profile = JSON.parse(JSON.stringify(profileData));
|
||||
return accountState.resolve(profile);
|
||||
return currentState.resolve(profile);
|
||||
},
|
||||
(error) => {
|
||||
error => {
|
||||
log.error("Could not retrieve profile data", error);
|
||||
return accountState.reject(error);
|
||||
})
|
||||
.then(null, err => Promise.reject(this._errorToErrorClass(err)));
|
||||
return currentState.reject(error);
|
||||
}
|
||||
).catch(err => Promise.reject(this._errorToErrorClass(err)));
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -17,9 +17,9 @@ this.EXPORTED_SYMBOLS = ["FxAccountsProfile"];
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FxAccountsCommon.js");
|
||||
Cu.import("resource://gre/modules/FxAccounts.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsProfileClient",
|
||||
"resource://gre/modules/FxAccountsProfileClient.jsm");
|
||||
@ -71,11 +71,12 @@ function hasChanged(oldData, newData) {
|
||||
return !deepEqual(oldData, newData);
|
||||
}
|
||||
|
||||
this.FxAccountsProfile = function (accountState, options = {}) {
|
||||
this.currentAccountState = accountState;
|
||||
this.FxAccountsProfile = function (options = {}) {
|
||||
this._cachedProfile = null;
|
||||
this.fxa = options.fxa || fxAccounts;
|
||||
this.client = options.profileClient || new FxAccountsProfileClient({
|
||||
fxa: this.fxa,
|
||||
serverURL: options.profileServerUrl,
|
||||
token: options.token
|
||||
});
|
||||
|
||||
// for testing
|
||||
@ -87,14 +88,15 @@ this.FxAccountsProfile = function (accountState, options = {}) {
|
||||
this.FxAccountsProfile.prototype = {
|
||||
|
||||
tearDown: function () {
|
||||
this.currentAccountState = null;
|
||||
this.fxa = null;
|
||||
this.client = null;
|
||||
this._cachedProfile = null;
|
||||
},
|
||||
|
||||
_getCachedProfile: function () {
|
||||
let currentState = this.currentAccountState;
|
||||
return currentState.getUserAccountData()
|
||||
.then(cachedData => cachedData.profile);
|
||||
// The cached profile will end up back in the generic accountData
|
||||
// once bug 1157529 is fixed.
|
||||
return Promise.resolve(this._cachedProfile);
|
||||
},
|
||||
|
||||
_notifyProfileChange: function (uid) {
|
||||
@ -104,18 +106,16 @@ this.FxAccountsProfile.prototype = {
|
||||
// Cache fetched data if it is different from what's in the cache.
|
||||
// Send out a notification if it has changed so that UI can update.
|
||||
_cacheProfile: function (profileData) {
|
||||
let currentState = this.currentAccountState;
|
||||
if (!currentState) {
|
||||
return;
|
||||
if (!hasChanged(this._cachedProfile, profileData)) {
|
||||
log.debug("fetched profile matches cached copy");
|
||||
return Promise.resolve(null); // indicates no change (but only tests care)
|
||||
}
|
||||
return currentState.getUserAccountData()
|
||||
.then(data => {
|
||||
if (!hasChanged(data.profile, profileData)) {
|
||||
return;
|
||||
}
|
||||
data.profile = profileData;
|
||||
return currentState.setUserAccountData(data)
|
||||
.then(() => this._notifyProfileChange(data.uid));
|
||||
this._cachedProfile = profileData;
|
||||
return this.fxa.getSignedInUser()
|
||||
.then(userData => {
|
||||
log.debug("notifying profile changed for user ${uid}", userData);
|
||||
this._notifyProfileChange(userData.uid);
|
||||
return profileData;
|
||||
});
|
||||
},
|
||||
|
||||
@ -133,7 +133,11 @@ this.FxAccountsProfile.prototype = {
|
||||
return this._getCachedProfile()
|
||||
.then(cachedProfile => {
|
||||
if (cachedProfile) {
|
||||
this._fetchAndCacheProfile();
|
||||
// Note that _fetchAndCacheProfile isn't returned, so continues
|
||||
// in the background.
|
||||
this._fetchAndCacheProfile().catch(err => {
|
||||
log.error("Background refresh of profile failed", err);
|
||||
});
|
||||
return cachedProfile;
|
||||
}
|
||||
return this._fetchAndCacheProfile();
|
||||
|
@ -5,6 +5,7 @@
|
||||
/**
|
||||
* A client to fetch profile information for a Firefox Account.
|
||||
*/
|
||||
"use strict;"
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["FxAccountsProfileClient", "FxAccountsProfileClientError"];
|
||||
|
||||
@ -13,6 +14,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://gre/modules/FxAccountsCommon.js");
|
||||
Cu.import("resource://gre/modules/FxAccounts.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
|
||||
Cu.importGlobalProperties(["URL"]);
|
||||
@ -29,16 +32,27 @@ Cu.importGlobalProperties(["URL"]);
|
||||
* @constructor
|
||||
*/
|
||||
this.FxAccountsProfileClient = function(options) {
|
||||
if (!options || !options.serverURL || !options.token) {
|
||||
throw new Error("Missing 'serverURL' or 'token' configuration option");
|
||||
if (!options || !options.serverURL) {
|
||||
throw new Error("Missing 'serverURL' configuration option");
|
||||
}
|
||||
|
||||
this.fxa = options.fxa || fxAccounts;
|
||||
// This is a work-around for loop that manages its own oauth tokens.
|
||||
// * If |token| is in options we use it and don't attempt any token refresh
|
||||
// on 401. This is for loop.
|
||||
// * If |token| doesn't exist we will fetch our own token. This is for the
|
||||
// normal FxAccounts methods for obtaining the profile.
|
||||
// We should nuke all |this.token| support once loop moves closer to FxAccounts.
|
||||
this.token = options.token;
|
||||
|
||||
try {
|
||||
this.serverURL = new URL(options.serverURL);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid 'serverURL'");
|
||||
}
|
||||
this.token = options.token;
|
||||
this.oauthOptions = {
|
||||
scope: "profile",
|
||||
};
|
||||
log.debug("FxAccountsProfileClient: Initialized");
|
||||
};
|
||||
|
||||
@ -49,19 +63,13 @@ this.FxAccountsProfileClient.prototype = {
|
||||
*/
|
||||
serverURL: null,
|
||||
|
||||
/**
|
||||
* {String}
|
||||
* Profile server bearer OAuth token.
|
||||
*/
|
||||
token: null,
|
||||
|
||||
/**
|
||||
* Interface for making remote requests.
|
||||
*/
|
||||
_Request: RESTRequest,
|
||||
|
||||
/**
|
||||
* Remote request helper
|
||||
* Remote request helper which abstracts authentication away.
|
||||
*
|
||||
* @param {String} path
|
||||
* Profile server path, i.e "/profile".
|
||||
@ -72,13 +80,55 @@ this.FxAccountsProfileClient.prototype = {
|
||||
* Rejects: {FxAccountsProfileClientError} Profile client error.
|
||||
* @private
|
||||
*/
|
||||
_createRequest: function(path, method = "GET") {
|
||||
_createRequest: Task.async(function* (path, method = "GET") {
|
||||
let token = this.token;
|
||||
if (!token) {
|
||||
// tokens are cached, so getting them each request is cheap.
|
||||
token = yield this.fxa.getOAuthToken(this.oauthOptions);
|
||||
}
|
||||
try {
|
||||
return (yield this._rawRequest(path, method, token));
|
||||
} catch (ex if ex instanceof FxAccountsProfileClientError && ex.code == 401) {
|
||||
// If this object was instantiated with a token then we don't refresh it.
|
||||
if (this.token) {
|
||||
throw ex;
|
||||
}
|
||||
// it's an auth error - assume our token expired and retry.
|
||||
log.info("Fetching the profile returned a 401 - revoking our token and retrying");
|
||||
yield this.fxa.removeCachedOAuthToken({token});
|
||||
token = yield this.fxa.getOAuthToken(this.oauthOptions);
|
||||
// and try with the new token - if that also fails then we fail after
|
||||
// revoking the token.
|
||||
try {
|
||||
return (yield this._rawRequest(path, method, token));
|
||||
} catch (ex if ex instanceof FxAccountsProfileClientError && ex.code == 401) {
|
||||
log.info("Retry fetching the profile still returned a 401 - revoking our token and failing");
|
||||
yield this.fxa.removeCachedOAuthToken({token});
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Remote "raw" request helper - doesn't handle auth errors and tokens.
|
||||
*
|
||||
* @param {String} path
|
||||
* Profile server path, i.e "/profile".
|
||||
* @param {String} method
|
||||
* Type of request, i.e "GET".
|
||||
* @param {String} token
|
||||
* @return Promise
|
||||
* Resolves: {Object} Successful response from the Profile server.
|
||||
* Rejects: {FxAccountsProfileClientError} Profile client error.
|
||||
* @private
|
||||
*/
|
||||
_rawRequest: function(path, method, token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let profileDataUrl = this.serverURL + path;
|
||||
let request = new this._Request(profileDataUrl);
|
||||
method = method.toUpperCase();
|
||||
|
||||
request.setHeader("Authorization", "Bearer " + this.token);
|
||||
request.setHeader("Authorization", "Bearer " + token);
|
||||
request.setHeader("Accept", "application/json");
|
||||
|
||||
request.onComplete = function (error) {
|
||||
@ -106,7 +156,12 @@ this.FxAccountsProfileClient.prototype = {
|
||||
if (request.response.success) {
|
||||
return resolve(body);
|
||||
} else {
|
||||
return reject(new FxAccountsProfileClientError(body));
|
||||
return reject(new FxAccountsProfileClientError({
|
||||
error: body.error || ERROR_UNKNOWN,
|
||||
errno: body.errno || ERRNO_UNKNOWN_ERROR,
|
||||
code: request.response.status,
|
||||
message: body.message || body,
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -960,29 +960,7 @@ add_test(function test_getOAuthToken_unknown_error() {
|
||||
});
|
||||
});
|
||||
|
||||
add_test(function test_accountState_initProfile() {
|
||||
let fxa = new MockFxAccounts();
|
||||
let alice = getTestUser("alice");
|
||||
alice.verified = true;
|
||||
|
||||
fxa.internal.getOAuthToken = function (opts) {
|
||||
return Promise.resolve("token");
|
||||
};
|
||||
|
||||
fxa.setSignedInUser(alice).then(() => {
|
||||
let accountState = fxa.internal.currentAccountState;
|
||||
|
||||
accountState.initProfile(options)
|
||||
.then(result => {
|
||||
do_check_true(!!accountState.profile);
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
add_test(function test_accountState_getProfile() {
|
||||
let fxa = new MockFxAccounts();
|
||||
add_test(function test_getSignedInUserProfile() {
|
||||
let alice = getTestUser("alice");
|
||||
alice.verified = true;
|
||||
|
||||
@ -991,40 +969,18 @@ add_test(function test_accountState_getProfile() {
|
||||
return Promise.resolve({ avatar: "image" });
|
||||
}
|
||||
};
|
||||
let fxa = new FxAccounts({
|
||||
_profile: mockProfile,
|
||||
});
|
||||
|
||||
fxa.setSignedInUser(alice).then(() => {
|
||||
let accountState = fxa.internal.currentAccountState;
|
||||
accountState.profile = mockProfile;
|
||||
accountState.initProfilePromise = new Promise((resolve, reject) => resolve(mockProfile));
|
||||
|
||||
accountState.getProfile()
|
||||
fxa.getSignedInUserProfile()
|
||||
.then(result => {
|
||||
do_check_true(!!result);
|
||||
do_check_eq(result.avatar, "image");
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
add_test(function test_getSignedInUserProfile_ok() {
|
||||
let fxa = new MockFxAccounts();
|
||||
let alice = getTestUser("alice");
|
||||
alice.verified = true;
|
||||
|
||||
fxa.setSignedInUser(alice).then(() => {
|
||||
let accountState = fxa.internal.currentAccountState;
|
||||
accountState.getProfile = function () {
|
||||
return Promise.resolve({ avatar: "image" });
|
||||
};
|
||||
|
||||
fxa.getSignedInUserProfile()
|
||||
.then(result => {
|
||||
do_check_eq(result.avatar, "image");
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
add_test(function test_getSignedInUserProfile_error_uses_account_data() {
|
||||
@ -1036,19 +992,26 @@ add_test(function test_getSignedInUserProfile_error_uses_account_data() {
|
||||
return Promise.resolve({ email: "foo@bar.com" });
|
||||
};
|
||||
|
||||
let teardownCalled = false;
|
||||
fxa.setSignedInUser(alice).then(() => {
|
||||
let accountState = fxa.internal.currentAccountState;
|
||||
accountState.getProfile = function () {
|
||||
return Promise.reject("boom");
|
||||
fxa.internal._profile = {
|
||||
getProfile: function () {
|
||||
return Promise.reject("boom");
|
||||
},
|
||||
tearDown: function() {
|
||||
teardownCalled = true;
|
||||
}
|
||||
};
|
||||
|
||||
fxa.getSignedInUserProfile()
|
||||
.catch(error => {
|
||||
do_check_eq(error.message, "UNKNOWN_ERROR");
|
||||
fxa.signOut().then(run_next_test);
|
||||
do_check_eq(error.message, "UNKNOWN_ERROR");
|
||||
fxa.signOut().then(() => {
|
||||
do_check_true(teardownCalled);
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
add_test(function test_getSignedInUserProfile_unverified_account() {
|
||||
@ -1056,8 +1019,6 @@ add_test(function test_getSignedInUserProfile_unverified_account() {
|
||||
let alice = getTestUser("alice");
|
||||
|
||||
fxa.setSignedInUser(alice).then(() => {
|
||||
let accountState = fxa.internal.currentAccountState;
|
||||
|
||||
fxa.getSignedInUserProfile()
|
||||
.catch(error => {
|
||||
do_check_eq(error.message, "UNVERIFIED_ACCOUNT");
|
||||
|
@ -11,12 +11,6 @@ Cu.import("resource://gre/modules/FxAccountsProfile.jsm");
|
||||
const URL_STRING = "https://example.com";
|
||||
Services.prefs.setCharPref("identity.fxaccounts.settings.uri", "https://example.com/settings");
|
||||
|
||||
const PROFILE_CLIENT_OPTIONS = {
|
||||
token: "123ABC",
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
profileServerUrl: "http://127.0.0.1:1111/v1"
|
||||
};
|
||||
|
||||
const STATUS_SUCCESS = 200;
|
||||
|
||||
/**
|
||||
@ -58,35 +52,53 @@ let mockResponseError = function (error) {
|
||||
};
|
||||
};
|
||||
|
||||
let mockClient = function () {
|
||||
let client = new FxAccountsProfileClient(PROFILE_CLIENT_OPTIONS);
|
||||
return client;
|
||||
let mockClient = function (fxa) {
|
||||
let options = {
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
fxa: fxa,
|
||||
}
|
||||
return new FxAccountsProfileClient(options);
|
||||
};
|
||||
|
||||
const ACCOUNT_DATA = {
|
||||
uid: "abc123"
|
||||
};
|
||||
|
||||
function AccountData () {
|
||||
function FxaMock() {
|
||||
}
|
||||
AccountData.prototype = {
|
||||
getUserAccountData: function () {
|
||||
FxaMock.prototype = {
|
||||
currentAccountState: {
|
||||
profile: null,
|
||||
get isCurrent() true,
|
||||
},
|
||||
|
||||
getSignedInUser: function () {
|
||||
return Promise.resolve(ACCOUNT_DATA);
|
||||
}
|
||||
};
|
||||
|
||||
let mockAccountData = function () {
|
||||
return new AccountData();
|
||||
let mockFxa = function() {
|
||||
return new FxaMock();
|
||||
};
|
||||
|
||||
function CreateFxAccountsProfile(fxa = null, client = null) {
|
||||
if (!fxa) {
|
||||
fxa = mockFxa();
|
||||
}
|
||||
let options = {
|
||||
fxa: fxa,
|
||||
profileServerUrl: "http://127.0.0.1:1111/v1"
|
||||
}
|
||||
if (client) {
|
||||
options.profileClient = client;
|
||||
}
|
||||
return new FxAccountsProfile(options);
|
||||
}
|
||||
|
||||
add_test(function getCachedProfile() {
|
||||
let accountData = mockAccountData();
|
||||
accountData.getUserAccountData = function () {
|
||||
return Promise.resolve({
|
||||
profile: { avatar: "myurl" }
|
||||
});
|
||||
};
|
||||
let profile = new FxAccountsProfile(accountData, PROFILE_CLIENT_OPTIONS);
|
||||
let profile = CreateFxAccountsProfile();
|
||||
// a little pointless until bug 1157529 is fixed...
|
||||
profile._cachedProfile = { avatar: "myurl" };
|
||||
|
||||
return profile._getCachedProfile()
|
||||
.then(function (cached) {
|
||||
@ -96,18 +108,20 @@ add_test(function getCachedProfile() {
|
||||
});
|
||||
|
||||
add_test(function cacheProfile_change() {
|
||||
let accountData = mockAccountData();
|
||||
let fxa = mockFxa();
|
||||
/* Saving profile data disabled - bug 1157529
|
||||
let setUserAccountDataCalled = false;
|
||||
accountData.setUserAccountData = function (data) {
|
||||
fxa.setUserAccountData = function (data) {
|
||||
setUserAccountDataCalled = true;
|
||||
do_check_eq(data.profile.avatar, "myurl");
|
||||
return Promise.resolve();
|
||||
};
|
||||
let profile = new FxAccountsProfile(accountData, PROFILE_CLIENT_OPTIONS);
|
||||
*/
|
||||
let profile = CreateFxAccountsProfile(fxa);
|
||||
|
||||
makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function (subject, topic, data) {
|
||||
do_check_eq(data, ACCOUNT_DATA.uid);
|
||||
do_check_true(setUserAccountDataCalled);
|
||||
// do_check_true(setUserAccountDataCalled); - bug 1157529
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
@ -115,16 +129,14 @@ add_test(function cacheProfile_change() {
|
||||
});
|
||||
|
||||
add_test(function cacheProfile_no_change() {
|
||||
let accountData = mockAccountData();
|
||||
accountData.getUserAccountData = function () {
|
||||
return Promise.resolve({
|
||||
profile: { avatar: "myurl" }
|
||||
});
|
||||
};
|
||||
accountData.setUserAccountData = function (data) {
|
||||
let fxa = mockFxa();
|
||||
let profile = CreateFxAccountsProfile(fxa)
|
||||
profile._cachedProfile = { avatar: "myurl" };
|
||||
// XXX - saving is disabled (but we can leave that in for now as we are
|
||||
// just checking it is *not* called)
|
||||
fxa.setSignedInUser = function (data) {
|
||||
throw new Error("should not update account data");
|
||||
};
|
||||
let profile = new FxAccountsProfile(accountData, PROFILE_CLIENT_OPTIONS);
|
||||
|
||||
return profile._cacheProfile({ avatar: "myurl" })
|
||||
.then((result) => {
|
||||
@ -134,13 +146,11 @@ add_test(function cacheProfile_no_change() {
|
||||
});
|
||||
|
||||
add_test(function fetchAndCacheProfile_ok() {
|
||||
let client = mockClient();
|
||||
let client = mockClient(mockFxa());
|
||||
client.fetchProfile = function () {
|
||||
return Promise.resolve({ avatar: "myimg"});
|
||||
};
|
||||
let profile = new FxAccountsProfile(mockAccountData(), {
|
||||
profileClient: client
|
||||
});
|
||||
let profile = CreateFxAccountsProfile(null, client);
|
||||
|
||||
profile._cacheProfile = function (toCache) {
|
||||
do_check_eq(toCache.avatar, "myimg");
|
||||
@ -155,13 +165,13 @@ add_test(function fetchAndCacheProfile_ok() {
|
||||
});
|
||||
|
||||
add_test(function tearDown_ok() {
|
||||
let profile = new FxAccountsProfile(mockAccountData(), PROFILE_CLIENT_OPTIONS);
|
||||
let profile = CreateFxAccountsProfile();
|
||||
|
||||
do_check_true(!!profile.client);
|
||||
do_check_true(!!profile.currentAccountState);
|
||||
do_check_true(!!profile.fxa);
|
||||
|
||||
profile.tearDown();
|
||||
do_check_null(profile.currentAccountState);
|
||||
do_check_null(profile.fxa);
|
||||
do_check_null(profile.client);
|
||||
|
||||
run_next_test();
|
||||
@ -169,16 +179,16 @@ add_test(function tearDown_ok() {
|
||||
|
||||
add_test(function getProfile_ok() {
|
||||
let cachedUrl = "myurl";
|
||||
let accountData = mockAccountData();
|
||||
let didFetch = false;
|
||||
|
||||
let profile = new FxAccountsProfile(accountData, PROFILE_CLIENT_OPTIONS);
|
||||
let profile = CreateFxAccountsProfile();
|
||||
profile._getCachedProfile = function () {
|
||||
return Promise.resolve({ avatar: cachedUrl });
|
||||
};
|
||||
|
||||
profile._fetchAndCacheProfile = function () {
|
||||
didFetch = true;
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
return profile.getProfile()
|
||||
@ -191,9 +201,7 @@ add_test(function getProfile_ok() {
|
||||
|
||||
add_test(function getProfile_no_cache() {
|
||||
let fetchedUrl = "newUrl";
|
||||
let accountData = mockAccountData();
|
||||
|
||||
let profile = new FxAccountsProfile(accountData, PROFILE_CLIENT_OPTIONS);
|
||||
let profile = CreateFxAccountsProfile();
|
||||
profile._getCachedProfile = function () {
|
||||
return Promise.resolve();
|
||||
};
|
||||
@ -212,23 +220,23 @@ add_test(function getProfile_no_cache() {
|
||||
add_test(function getProfile_has_cached_fetch_deleted() {
|
||||
let cachedUrl = "myurl";
|
||||
|
||||
let client = mockClient();
|
||||
let fxa = mockFxa();
|
||||
let client = mockClient(fxa);
|
||||
client.fetchProfile = function () {
|
||||
return Promise.resolve({ avatar: null });
|
||||
};
|
||||
|
||||
let accountData = mockAccountData();
|
||||
accountData.getUserAccountData = function () {
|
||||
return Promise.resolve({ profile: { avatar: cachedUrl } });
|
||||
};
|
||||
accountData.setUserAccountData = function (data) {
|
||||
do_check_null(data.profile.avatar);
|
||||
run_next_test();
|
||||
return Promise.resolve();
|
||||
};
|
||||
let profile = CreateFxAccountsProfile(fxa, client);
|
||||
profile._cachedProfile = { avatar: cachedUrl };
|
||||
|
||||
let profile = new FxAccountsProfile(accountData, {
|
||||
profileClient: client
|
||||
// instead of checking this in a mocked "save" function, just check after the
|
||||
// observer
|
||||
makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function (subject, topic, data) {
|
||||
profile.getProfile()
|
||||
.then(profileData => {
|
||||
do_check_null(profileData.avatar);
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
return profile.getProfile()
|
||||
|
@ -6,11 +6,6 @@
|
||||
Cu.import("resource://gre/modules/FxAccountsCommon.js");
|
||||
Cu.import("resource://gre/modules/FxAccountsProfileClient.jsm");
|
||||
|
||||
const PROFILE_OPTIONS = {
|
||||
token: "123ABC",
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
};
|
||||
|
||||
const STATUS_SUCCESS = 200;
|
||||
|
||||
/**
|
||||
@ -35,6 +30,21 @@ let mockResponse = function (response) {
|
||||
return Request;
|
||||
};
|
||||
|
||||
// A simple mock FxA that hands out tokens without checking them and doesn't
|
||||
// expect tokens to be revoked. We have specific token tests further down that
|
||||
// has more checks here.
|
||||
let mockFxa = {
|
||||
getOAuthToken(options) {
|
||||
do_check_eq(options.scope, "profile");
|
||||
return "token";
|
||||
}
|
||||
}
|
||||
|
||||
const PROFILE_OPTIONS = {
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
fxa: mockFxa,
|
||||
};
|
||||
|
||||
/**
|
||||
* Mock request error responder
|
||||
* @param {Error} error
|
||||
@ -98,8 +108,8 @@ add_test(function parseErrorResponse () {
|
||||
add_test(function serverErrorResponse () {
|
||||
let client = new FxAccountsProfileClient(PROFILE_OPTIONS);
|
||||
let response = {
|
||||
status: 401,
|
||||
body: "{ \"code\": 401, \"errno\": 100, \"error\": \"Bad Request\", \"message\": \"Unauthorized\", \"reason\": \"Bearer token not provided\" }",
|
||||
status: 500,
|
||||
body: "{ \"code\": 500, \"errno\": 100, \"error\": \"Bad Request\", \"message\": \"Something went wrong\", \"reason\": \"Because the internet\" }",
|
||||
};
|
||||
|
||||
client._Request = new mockResponse(response);
|
||||
@ -108,10 +118,149 @@ add_test(function serverErrorResponse () {
|
||||
null,
|
||||
function (e) {
|
||||
do_check_eq(e.name, "FxAccountsProfileClientError");
|
||||
do_check_eq(e.code, 401);
|
||||
do_check_eq(e.code, 500);
|
||||
do_check_eq(e.errno, 100);
|
||||
do_check_eq(e.error, "Bad Request");
|
||||
do_check_eq(e.message, "Unauthorized");
|
||||
do_check_eq(e.message, "Something went wrong");
|
||||
run_next_test();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test that we get a token, then if we get a 401 we revoke it, get a new one
|
||||
// and retry.
|
||||
add_test(function server401ResponseThenSuccess () {
|
||||
// The last token we handed out.
|
||||
let lastToken = -1;
|
||||
// The number of times our removeCachedOAuthToken function was called.
|
||||
let numTokensRemoved = 0;
|
||||
|
||||
let mockFxa = {
|
||||
getOAuthToken(options) {
|
||||
do_check_eq(options.scope, "profile");
|
||||
return "" + ++lastToken; // tokens are strings.
|
||||
},
|
||||
removeCachedOAuthToken(options) {
|
||||
// This test never has more than 1 token alive at once, so the token
|
||||
// being revoked must always be the last token we handed out.
|
||||
do_check_eq(parseInt(options.token), lastToken);
|
||||
++numTokensRemoved;
|
||||
}
|
||||
}
|
||||
let profileOptions = {
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
fxa: mockFxa,
|
||||
};
|
||||
let client = new FxAccountsProfileClient(profileOptions);
|
||||
|
||||
// 2 responses - first one implying the token has expired, second works.
|
||||
let responses = [
|
||||
{
|
||||
status: 401,
|
||||
body: "{ \"code\": 401, \"errno\": 100, \"error\": \"Token expired\", \"message\": \"That token is too old\", \"reason\": \"Because security\" }",
|
||||
},
|
||||
{
|
||||
success: true,
|
||||
status: STATUS_SUCCESS,
|
||||
body: "{\"avatar\":\"http://example.com/image.jpg\",\"id\":\"0d5c1a89b8c54580b8e3e8adadae864a\"}",
|
||||
},
|
||||
];
|
||||
|
||||
let numRequests = 0;
|
||||
let numAuthHeaders = 0;
|
||||
// Like mockResponse but we want access to headers etc.
|
||||
client._Request = function(requestUri) {
|
||||
return {
|
||||
setHeader: function (name, value) {
|
||||
if (name == "Authorization") {
|
||||
numAuthHeaders++;
|
||||
do_check_eq(value, "Bearer " + lastToken);
|
||||
}
|
||||
},
|
||||
get: function () {
|
||||
this.response = responses[numRequests];
|
||||
++numRequests;
|
||||
this.onComplete();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
client.fetchProfile()
|
||||
.then(result => {
|
||||
do_check_eq(result.avatar, "http://example.com/image.jpg");
|
||||
do_check_eq(result.id, "0d5c1a89b8c54580b8e3e8adadae864a");
|
||||
// should have been exactly 2 requests and exactly 2 auth headers.
|
||||
do_check_eq(numRequests, 2);
|
||||
do_check_eq(numAuthHeaders, 2);
|
||||
// and we should have seen one token revoked.
|
||||
do_check_eq(numTokensRemoved, 1);
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Test that we get a token, then if we get a 401 we revoke it, get a new one
|
||||
// and retry - but we *still* get a 401 on the retry, so the caller sees that.
|
||||
add_test(function server401ResponsePersists () {
|
||||
// The last token we handed out.
|
||||
let lastToken = -1;
|
||||
// The number of times our removeCachedOAuthToken function was called.
|
||||
let numTokensRemoved = 0;
|
||||
|
||||
let mockFxa = {
|
||||
getOAuthToken(options) {
|
||||
do_check_eq(options.scope, "profile");
|
||||
return "" + ++lastToken; // tokens are strings.
|
||||
},
|
||||
removeCachedOAuthToken(options) {
|
||||
// This test never has more than 1 token alive at once, so the token
|
||||
// being revoked must always be the last token we handed out.
|
||||
do_check_eq(parseInt(options.token), lastToken);
|
||||
++numTokensRemoved;
|
||||
}
|
||||
}
|
||||
let profileOptions = {
|
||||
serverURL: "http://127.0.0.1:1111/v1",
|
||||
fxa: mockFxa,
|
||||
};
|
||||
let client = new FxAccountsProfileClient(profileOptions);
|
||||
|
||||
let response = {
|
||||
status: 401,
|
||||
body: "{ \"code\": 401, \"errno\": 100, \"error\": \"It's not your token, it's you!\", \"message\": \"I don't like you\", \"reason\": \"Because security\" }",
|
||||
};
|
||||
|
||||
let numRequests = 0;
|
||||
let numAuthHeaders = 0;
|
||||
client._Request = function(requestUri) {
|
||||
return {
|
||||
setHeader: function (name, value) {
|
||||
if (name == "Authorization") {
|
||||
numAuthHeaders++;
|
||||
do_check_eq(value, "Bearer " + lastToken);
|
||||
}
|
||||
},
|
||||
get: function () {
|
||||
this.response = response;
|
||||
++numRequests;
|
||||
this.onComplete();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
client.fetchProfile().then(
|
||||
null,
|
||||
function (e) {
|
||||
do_check_eq(e.name, "FxAccountsProfileClientError");
|
||||
do_check_eq(e.code, 401);
|
||||
do_check_eq(e.errno, 100);
|
||||
do_check_eq(e.error, "It's not your token, it's you!");
|
||||
// should have been exactly 2 requests and exactly 2 auth headers.
|
||||
do_check_eq(numRequests, 2);
|
||||
do_check_eq(numAuthHeaders, 2);
|
||||
// and we should have seen both tokens revoked.
|
||||
do_check_eq(numTokensRemoved, 2);
|
||||
run_next_test();
|
||||
}
|
||||
);
|
||||
@ -119,8 +268,8 @@ add_test(function serverErrorResponse () {
|
||||
|
||||
add_test(function networkErrorResponse () {
|
||||
let client = new FxAccountsProfileClient({
|
||||
token: "123ABC",
|
||||
serverURL: "http://"
|
||||
serverURL: "http://",
|
||||
fxa: mockFxa,
|
||||
});
|
||||
client.fetchProfile()
|
||||
.then(
|
||||
@ -191,18 +340,12 @@ add_test(function fetchProfileImage_successfulResponse () {
|
||||
|
||||
add_test(function constructorTests() {
|
||||
validationHelper(undefined,
|
||||
"Error: Missing 'serverURL' or 'token' configuration option");
|
||||
"Error: Missing 'serverURL' configuration option");
|
||||
|
||||
validationHelper({},
|
||||
"Error: Missing 'serverURL' or 'token' configuration option");
|
||||
"Error: Missing 'serverURL' configuration option");
|
||||
|
||||
validationHelper({ serverURL: "http://example.com" },
|
||||
"Error: Missing 'serverURL' or 'token' configuration option");
|
||||
|
||||
validationHelper({ token: "123ABC" },
|
||||
"Error: Missing 'serverURL' or 'token' configuration option");
|
||||
|
||||
validationHelper({ token: "123ABC", serverURL: "badUrl" },
|
||||
validationHelper({ serverURL: "badUrl" },
|
||||
"Error: Invalid 'serverURL'");
|
||||
|
||||
run_next_test();
|
||||
@ -255,6 +398,10 @@ function run_test() {
|
||||
* @returns {*}
|
||||
*/
|
||||
function validationHelper(options, expected) {
|
||||
// add fxa to options - that missing isn't what we are testing here.
|
||||
if (options) {
|
||||
options.fxa = mockFxa;
|
||||
}
|
||||
try {
|
||||
new FxAccountsProfileClient(options);
|
||||
} catch (e) {
|
||||
|
@ -882,6 +882,23 @@ LoginManagerPrompter.prototype = {
|
||||
chromeDoc.getElementById("password-notification-password").type = "password";
|
||||
};
|
||||
|
||||
let onNotificationClick = (clickEvent) => {
|
||||
// Removes focus from textboxes when we click elsewhere on the doorhanger.
|
||||
let focusedElement = Services.focus.focusedElement;
|
||||
if (!focusedElement || focusedElement.nodeName != "html:input") {
|
||||
// No input is focused so we don't need to blur
|
||||
return;
|
||||
}
|
||||
|
||||
let focusedBindingParent = chromeDoc.getBindingParent(focusedElement);
|
||||
if (!focusedBindingParent || focusedBindingParent.nodeName != "textbox" ||
|
||||
clickEvent.explicitOriginalTarget == focusedBindingParent) {
|
||||
// The focus wasn't in a textbox or the click was in the focused textbox.
|
||||
return;
|
||||
}
|
||||
focusedBindingParent.blur();
|
||||
};
|
||||
|
||||
let persistData = () => {
|
||||
let foundLogins = Services.logins.findLogins({}, login.hostname,
|
||||
login.formSubmitURL,
|
||||
@ -966,6 +983,8 @@ LoginManagerPrompter.prototype = {
|
||||
.addEventListener("blur", onPasswordBlur);
|
||||
break;
|
||||
case "shown":
|
||||
chromeDoc.getElementById("notification-popup")
|
||||
.addEventListener("click", onNotificationClick);
|
||||
writeDataToUI();
|
||||
break;
|
||||
case "dismissed":
|
||||
@ -973,6 +992,8 @@ LoginManagerPrompter.prototype = {
|
||||
// Fall through.
|
||||
case "removed":
|
||||
currentNotification = null;
|
||||
chromeDoc.getElementById("notification-popup")
|
||||
.removeEventListener("click", onNotificationClick);
|
||||
chromeDoc.getElementById("password-notification-username")
|
||||
.removeEventListener("input", onInput);
|
||||
chromeDoc.getElementById("password-notification-password")
|
||||
|
@ -1,33 +1,43 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/* globals LayoutHelpers, DOMUtils, CssLogic, setIgnoreLayoutChanges */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {Cu, Cc, Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const protocol = require("devtools/server/protocol");
|
||||
const {Arg, Option, method, RetVal} = protocol;
|
||||
const events = require("sdk/event/core");
|
||||
const Heritage = require("sdk/core/heritage");
|
||||
const {CssLogic} = require("devtools/styleinspector/css-logic");
|
||||
const EventEmitter = require("devtools/toolkit/event-emitter");
|
||||
const {setIgnoreLayoutChanges} = require("devtools/server/actors/layout");
|
||||
|
||||
Cu.import("resource://gre/modules/devtools/LayoutHelpers.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
loader.lazyRequireGetter(this, "CssLogic",
|
||||
"devtools/styleinspector/css-logic", true);
|
||||
loader.lazyRequireGetter(this, "setIgnoreLayoutChanges",
|
||||
"devtools/server/actors/layout", true);
|
||||
loader.lazyGetter(this, "DOMUtils", function() {
|
||||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
});
|
||||
loader.lazyImporter(this, "LayoutHelpers",
|
||||
"resource://gre/modules/devtools/LayoutHelpers.jsm");
|
||||
|
||||
// FIXME: add ":visited" and ":link" after bug 713106 is fixed
|
||||
const PSEUDO_CLASSES = [":hover", ":active", ":focus"];
|
||||
// Note that the order of items in this array is important because it is used
|
||||
// for drawing the BoxModelHighlighter's path elements correctly.
|
||||
const BOX_MODEL_REGIONS = ["margin", "border", "padding", "content"];
|
||||
const BOX_MODEL_SIDES = ["top", "right", "bottom", "left"];
|
||||
const SVG_NS = "http://www.w3.org/2000/svg";
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
const HIGHLIGHTER_STYLESHEET_URI = "resource://gre/modules/devtools/server/actors/highlighter.css";
|
||||
const STYLESHEET_URI = "resource://gre/modules/devtools/server/actors/" +
|
||||
"highlighter.css";
|
||||
const HIGHLIGHTER_PICKED_TIMER = 1000;
|
||||
// How high is the nodeinfobar
|
||||
const NODE_INFOBAR_HEIGHT = 34; //px
|
||||
const NODE_INFOBAR_ARROW_SIZE = 9; // px
|
||||
// How high is the nodeinfobar (px).
|
||||
const NODE_INFOBAR_HEIGHT = 34;
|
||||
// What's the size of the nodeinfobar arrow (px).
|
||||
const NODE_INFOBAR_ARROW_SIZE = 9;
|
||||
// Width of boxmodelhighlighter guides
|
||||
const GUIDE_STROKE_WIDTH = 1;
|
||||
// The minimum distance a line should be before it has an arrow marker-end
|
||||
@ -44,8 +54,6 @@ const SIMPLE_OUTLINE_SHEET = ".__fx-devtools-hide-shortcut__ {" +
|
||||
" outline: 2px dashed #F06!important;" +
|
||||
" outline-offset: -2px!important;" +
|
||||
"}";
|
||||
// Distance of the width or height handles from the node's edge.
|
||||
const GEOMETRY_SIZE_ARROW_OFFSET = .25; // 25%
|
||||
const GEOMETRY_LABEL_SIZE = 6;
|
||||
|
||||
// Maximum size, in pixel, for the horizontal ruler and vertical ruler
|
||||
@ -83,11 +91,11 @@ exports.isTypeRegistered = isTypeRegistered;
|
||||
*/
|
||||
const register = (constructor, typeName=constructor.prototype.typeName) => {
|
||||
if (!typeName) {
|
||||
throw Error("No type's name found, or provided.")
|
||||
throw Error("No type's name found, or provided.");
|
||||
}
|
||||
|
||||
if (highlighterTypes.has(typeName)) {
|
||||
throw Error(`${typeName} is already registered.`)
|
||||
throw Error(`${typeName} is already registered.`);
|
||||
}
|
||||
|
||||
highlighterTypes.set(typeName, constructor);
|
||||
@ -110,8 +118,9 @@ exports.register = register;
|
||||
* conveniently retrieved via the InspectorActor's 'getHighlighter' method.
|
||||
* The InspectorActor will always return the same instance of
|
||||
* HighlighterActor if asked several times and this instance is used in the
|
||||
* toolbox to highlighter elements's box-model from the markup-view, layout-view,
|
||||
* console, debugger, ... as well as select elements with the pointer (pick).
|
||||
* toolbox to highlighter elements's box-model from the markup-view,
|
||||
* layout-view, console, debugger, ... as well as select elements with the
|
||||
* pointer (pick).
|
||||
*
|
||||
* Other types of highlighter actors exist and can be accessed via the
|
||||
* InspectorActor's 'getHighlighterByType' method.
|
||||
@ -282,7 +291,7 @@ let HighlighterActor = exports.HighlighterActor = protocol.ActorClass({
|
||||
this._preventContentEvent(event);
|
||||
this._currentNode = this._findAndAttachElement(event);
|
||||
if (this._hoveredNode !== this._currentNode.node) {
|
||||
this._highlighter.show( this._currentNode.node.rawNode);
|
||||
this._highlighter.show(this._currentNode.node.rawNode);
|
||||
events.emit(this._walker, "picker-node-hovered", this._currentNode);
|
||||
this._hoveredNode = this._currentNode.node;
|
||||
}
|
||||
@ -303,15 +312,17 @@ let HighlighterActor = exports.HighlighterActor = protocol.ActorClass({
|
||||
* ENTER/CARRIAGE_RETURN: Picks currentNode
|
||||
* ESC: Cancels picker, picks currentNode
|
||||
*/
|
||||
switch(event.keyCode) {
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_LEFT: // wider
|
||||
switch (event.keyCode) {
|
||||
// Wider.
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_LEFT:
|
||||
if (!currentNode.parentElement) {
|
||||
return;
|
||||
}
|
||||
currentNode = currentNode.parentElement;
|
||||
break;
|
||||
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_RIGHT: // narrower
|
||||
// Narrower.
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_RIGHT:
|
||||
if (!currentNode.children.length) {
|
||||
return;
|
||||
}
|
||||
@ -330,11 +341,13 @@ let HighlighterActor = exports.HighlighterActor = protocol.ActorClass({
|
||||
currentNode = child;
|
||||
break;
|
||||
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_RETURN: // select element
|
||||
// Select the element.
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_RETURN:
|
||||
this._onPick(event);
|
||||
return;
|
||||
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE: // cancel picking
|
||||
// Cancel pick mode.
|
||||
case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE:
|
||||
this.cancelPick();
|
||||
events.emit(this._walker, "picker-node-canceled");
|
||||
return;
|
||||
@ -458,15 +471,17 @@ let CustomHighlighterActor = exports.CustomHighlighterActor = protocol.ActorClas
|
||||
* method.
|
||||
*
|
||||
* Most custom highlighters are made to highlight DOM nodes, hence the first
|
||||
* NodeActor argument (NodeActor as in toolkit/devtools/server/actor/inspector).
|
||||
* NodeActor argument (NodeActor as in
|
||||
* toolkit/devtools/server/actor/inspector).
|
||||
* Note however that some highlighters use this argument merely as a context
|
||||
* node: the RectHighlighter for instance uses it to calculate the absolute
|
||||
* position of the provided rect. The SelectHighlighter uses it as a base node
|
||||
* to run the provided CSS selector on.
|
||||
*
|
||||
* @param NodeActor The node to be highlighted
|
||||
* @param Object Options for the custom highlighter
|
||||
* @return Boolean True, if the highlighter has been successfully shown (FF41+)
|
||||
* @param {NodeActor} The node to be highlighted
|
||||
* @param {Object} Options for the custom highlighter
|
||||
* @return {Boolean} True, if the highlighter has been successfully shown
|
||||
* (FF41+)
|
||||
*/
|
||||
show: method(function(node, options) {
|
||||
if (!node || !isNodeValid(node.rawNode) || !this._highlighter) {
|
||||
@ -509,7 +524,6 @@ let CustomHighlighterActor = exports.CustomHighlighterActor = protocol.ActorClas
|
||||
this._highlighter.destroy();
|
||||
this._highlighter = null;
|
||||
}
|
||||
|
||||
}, {
|
||||
oneway: true
|
||||
})
|
||||
@ -541,7 +555,8 @@ function CanvasFrameAnonymousContentHelper(highlighterEnv, nodeBuilder) {
|
||||
this.nodeBuilder = nodeBuilder;
|
||||
this.anonymousContentDocument = this.highlighterEnv.document;
|
||||
// XXX the next line is a wallpaper for bug 1123362.
|
||||
this.anonymousContentGlobal = Cu.getGlobalForObject(this.anonymousContentDocument);
|
||||
this.anonymousContentGlobal = Cu.getGlobalForObject(
|
||||
this.anonymousContentDocument);
|
||||
|
||||
this._insert();
|
||||
|
||||
@ -555,12 +570,13 @@ exports.CanvasFrameAnonymousContentHelper = CanvasFrameAnonymousContentHelper;
|
||||
|
||||
CanvasFrameAnonymousContentHelper.prototype = {
|
||||
destroy: function() {
|
||||
// If the current window isn't the one the content was inserted into, this
|
||||
// will fail, but that's fine.
|
||||
try {
|
||||
let doc = this.anonymousContentDocument;
|
||||
doc.removeAnonymousContent(this._content);
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
// If the current window isn't the one the content was inserted into, this
|
||||
// will fail, but that's fine.
|
||||
}
|
||||
this.highlighterEnv.off("navigate", this._onNavigate);
|
||||
this.highlighterEnv = this.nodeBuilder = this._content = null;
|
||||
this.anonymousContentDocument = null;
|
||||
@ -597,7 +613,7 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
||||
// If it did, highlighter.css would be injected as an anonymous content
|
||||
// node using CanvasFrameAnonymousContentHelper instead.
|
||||
installHelperSheet(this.highlighterEnv.window,
|
||||
"@import url('" + HIGHLIGHTER_STYLESHEET_URI + "');");
|
||||
"@import url('" + STYLESHEET_URI + "');");
|
||||
let node = this.nodeBuilder();
|
||||
this._content = doc.insertAnonymousContent(node);
|
||||
},
|
||||
@ -689,7 +705,7 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
||||
let target = this.highlighterEnv.pageListenerTarget;
|
||||
target.addEventListener(type, this, true);
|
||||
// Each type entry in the map is a map of ids:handlers.
|
||||
this.listeners.set(type, new Map);
|
||||
this.listeners.set(type, new Map());
|
||||
}
|
||||
|
||||
let listeners = this.listeners.get(type);
|
||||
@ -701,9 +717,8 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
||||
* canvasFrame native anonymous container.
|
||||
* @param {String} id
|
||||
* @param {String} type
|
||||
* @param {Function} handler
|
||||
*/
|
||||
removeEventListenerForElement: function(id, type, handler) {
|
||||
removeEventListenerForElement: function(id, type) {
|
||||
let listeners = this.listeners.get(type);
|
||||
if (!listeners) {
|
||||
return;
|
||||
@ -734,9 +749,8 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
||||
return () => {
|
||||
isPropagationStopped = true;
|
||||
};
|
||||
} else {
|
||||
return obj[name];
|
||||
}
|
||||
return obj[name];
|
||||
}
|
||||
});
|
||||
|
||||
@ -816,8 +830,8 @@ CanvasFrameAnonymousContentHelper.prototype = {
|
||||
|
||||
if (zoom !== 1) {
|
||||
value = "position:absolute;";
|
||||
value += "transform-origin:top left;transform:scale(" + (1/zoom) + ");";
|
||||
value += "width:" + (100*zoom) + "%;height:" + (100*zoom) + "%;";
|
||||
value += "transform-origin:top left;transform:scale(" + (1 / zoom) + ");";
|
||||
value += "width:" + (100 * zoom) + "%;height:" + (100 * zoom) + "%;";
|
||||
}
|
||||
|
||||
this.setAttributeForElement(id, "style", value);
|
||||
@ -953,7 +967,7 @@ AutoRefreshHighlighter.prototype = {
|
||||
/**
|
||||
* Update the highlighter if the node has moved since the last update.
|
||||
*/
|
||||
update: function(e) {
|
||||
update: function() {
|
||||
if (!isNodeValid(this.currentNode) || !this._hasMoved()) {
|
||||
return;
|
||||
}
|
||||
@ -1252,7 +1266,7 @@ BoxModelHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.prototype
|
||||
* Show the highlighter on a given node
|
||||
*/
|
||||
_show: function() {
|
||||
if (BOX_MODEL_REGIONS.indexOf(this.options.region) == -1) {
|
||||
if (BOX_MODEL_REGIONS.indexOf(this.options.region) == -1) {
|
||||
this.options.region = "content";
|
||||
}
|
||||
|
||||
@ -1590,15 +1604,17 @@ BoxModelHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.prototype
|
||||
return;
|
||||
}
|
||||
|
||||
let {bindingElement:node, pseudo} =
|
||||
CssLogic.getBindingElementAndPseudo(this.currentNode);
|
||||
let {bindingElement: node, pseudo} =
|
||||
CssLogic.getBindingElementAndPseudo(this.currentNode);
|
||||
|
||||
// Update the tag, id, classes, pseudo-classes and dimensions
|
||||
let tagName = node.tagName;
|
||||
|
||||
let id = node.id ? "#" + node.id : "";
|
||||
|
||||
let classList = (node.classList || []).length ? "." + [...node.classList].join(".") : "";
|
||||
let classList = (node.classList || []).length
|
||||
? "." + [...node.classList].join(".")
|
||||
: "";
|
||||
|
||||
let pseudos = PSEUDO_CLASSES.filter(pseudo => {
|
||||
return DOMUtils.hasPseudoClassLock(node, pseudo);
|
||||
@ -1609,7 +1625,9 @@ BoxModelHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.prototype
|
||||
}
|
||||
|
||||
let rect = this._getOuterQuad("border").bounds;
|
||||
let dim = parseFloat(rect.width.toPrecision(6)) + " \u00D7 " + parseFloat(rect.height.toPrecision(6));
|
||||
let dim = parseFloat(rect.width.toPrecision(6)) +
|
||||
" \u00D7 " +
|
||||
parseFloat(rect.height.toPrecision(6));
|
||||
|
||||
this.getElement("nodeinfobar-tagname").setTextContent(tagName);
|
||||
this.getElement("nodeinfobar-id").setTextContent(id);
|
||||
@ -1694,8 +1712,6 @@ CssTransformHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.proto
|
||||
ID_CLASS_PREFIX: "css-transform-",
|
||||
|
||||
_buildMarkup: function() {
|
||||
let doc = this.win.document;
|
||||
|
||||
let container = createNode(this.win, {
|
||||
attributes: {
|
||||
"class": "highlighter-container"
|
||||
@ -1726,7 +1742,7 @@ CssTransformHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.proto
|
||||
|
||||
// Add a marker tag to the svg root for the arrow tip
|
||||
this.markerId = "arrow-marker-" + MARKER_COUNTER;
|
||||
MARKER_COUNTER ++;
|
||||
MARKER_COUNTER++;
|
||||
let marker = createSVGNode(this.win, {
|
||||
nodeType: "marker",
|
||||
parent: svg,
|
||||
@ -1827,7 +1843,7 @@ CssTransformHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.proto
|
||||
|
||||
_setPolygonPoints: function(quad, id) {
|
||||
let points = [];
|
||||
for (let point of ["p1","p2", "p3", "p4"]) {
|
||||
for (let point of ["p1", "p2", "p3", "p4"]) {
|
||||
points.push(quad[point].x + "," + quad[point].y);
|
||||
}
|
||||
this.getElement(id).setAttribute("points", points.join(" "));
|
||||
@ -1936,7 +1952,10 @@ SelectorHighlighter.prototype = {
|
||||
let nodes = [];
|
||||
try {
|
||||
nodes = [...node.ownerDocument.querySelectorAll(options.selector)];
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
// It's fine if the provided selector is invalid, nodes will be an empty
|
||||
// array.
|
||||
}
|
||||
|
||||
delete options.selector;
|
||||
|
||||
@ -1952,7 +1971,7 @@ SelectorHighlighter.prototype = {
|
||||
}
|
||||
highlighter.show(matchingNode, options);
|
||||
this._highlighters.push(highlighter);
|
||||
i ++;
|
||||
i++;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1995,8 +2014,8 @@ RectHighlighter.prototype = {
|
||||
|
||||
let container = doc.createElement("div");
|
||||
container.className = "highlighter-container";
|
||||
container.innerHTML = '<div id="highlighted-rect" ' +
|
||||
'class="highlighted-rect" hidden="true">';
|
||||
container.innerHTML = "<div id=\"highlighted-rect\" " +
|
||||
"class=\"highlighted-rect\" hidden=\"true\">";
|
||||
|
||||
return container;
|
||||
},
|
||||
@ -2026,7 +2045,8 @@ RectHighlighter.prototype = {
|
||||
* the parent documentElement and use it as context to position the
|
||||
* highlighter correctly.
|
||||
* @param {Object} options Accepts the following options:
|
||||
* - rect: mandatory object that should have the x, y, width, height properties
|
||||
* - rect: mandatory object that should have the x, y, width, height
|
||||
* properties
|
||||
* - fill: optional fill color for the rect
|
||||
*/
|
||||
show: function(node, options) {
|
||||
@ -2351,8 +2371,8 @@ GeometryEditorHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.pro
|
||||
for (let name of GeoProp.allProps()) {
|
||||
let value = rule.style.getPropertyValue(name);
|
||||
if (value && value !== "auto") {
|
||||
// getCSSStyleRules returns rules ordered from least-specific to
|
||||
// most-specific, so just override any previous properties we have set.
|
||||
// getCSSStyleRules returns rules ordered from least to most specific
|
||||
// so just override any previous properties we have set.
|
||||
props.set(name, {
|
||||
cssRule: rule
|
||||
});
|
||||
@ -2418,9 +2438,6 @@ GeometryEditorHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.pro
|
||||
// list of defined properties, and re-position the arrows and highlighters.
|
||||
this.definedProperties = this.getDefinedGeometryProperties();
|
||||
|
||||
let isStatic = this.computedStyle.position === "static";
|
||||
let hasSizes = GeoProp.containsSize([...this.definedProperties.keys()]);
|
||||
|
||||
if (!this.definedProperties.size) {
|
||||
console.warn("The element does not have editable geometry properties");
|
||||
return false;
|
||||
@ -2564,10 +2581,6 @@ GeometryEditorHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.pro
|
||||
|
||||
// Position arrows always end at the node's margin box.
|
||||
let marginBox = this.currentQuads.margin[0].bounds;
|
||||
// But size arrows are displayed in the box that corresponds to the current
|
||||
// box-sizing.
|
||||
let boxSizing = this.computedStyle.boxSizing.split("-")[0];
|
||||
let box = this.currentQuads[boxSizing][0].bounds;
|
||||
|
||||
// Position the side arrows which need to be visible.
|
||||
// Arrows always start at the offsetParent edge, and end at the middle
|
||||
@ -2594,18 +2607,16 @@ GeometryEditorHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.pro
|
||||
if (this.computedStyle.position === "relative") {
|
||||
if (GeoProp.isInverted(side)) {
|
||||
return marginBox[side] + parseFloat(this.computedStyle[side]);
|
||||
} else {
|
||||
return marginBox[side] - parseFloat(this.computedStyle[side]);
|
||||
}
|
||||
return marginBox[side] - parseFloat(this.computedStyle[side]);
|
||||
}
|
||||
|
||||
// In case the element is positioned in the viewport.
|
||||
if (GeoProp.isInverted(side)) {
|
||||
return this.offsetParent.dimension[GeoProp.mainAxisSize(side)];
|
||||
} else {
|
||||
return -1 * getWindow(this.currentNode)["scroll" +
|
||||
GeoProp.axis(side).toUpperCase()];
|
||||
}
|
||||
return -1 * getWindow(this.currentNode)["scroll" +
|
||||
GeoProp.axis(side).toUpperCase()];
|
||||
};
|
||||
|
||||
for (let side of GeoProp.SIDES) {
|
||||
@ -2639,7 +2650,7 @@ GeometryEditorHighlighter.prototype = Heritage.extend(AutoRefreshHighlighter.pro
|
||||
// Position the label <text> in the middle of the arrow (making sure it's
|
||||
// not hidden below the fold).
|
||||
let capitalize = str => str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||
let winMain = this.win["inner" + capitalize(GeoProp.mainAxisSize(side))]
|
||||
let winMain = this.win["inner" + capitalize(GeoProp.mainAxisSize(side))];
|
||||
let labelMain = mainStart + (mainEnd - mainStart) / 2;
|
||||
if ((mainStart > 0 && mainStart < winMain) ||
|
||||
(mainEnd > 0 && mainEnd < winMain)) {
|
||||
@ -2674,7 +2685,7 @@ function RulersHighlighter(highlighterEnv) {
|
||||
this.win.addEventListener("pagehide", this, true);
|
||||
}
|
||||
|
||||
RulersHighlighter.prototype = {
|
||||
RulersHighlighter.prototype = {
|
||||
typeName: "RulersHighlighter",
|
||||
|
||||
ID_CLASS_PREFIX: "rulers-highlighter-",
|
||||
@ -2762,8 +2773,10 @@ RulersHighlighter.prototype = {
|
||||
let dMarkers = "";
|
||||
let graduationLength;
|
||||
|
||||
for (let i = 0; i < size; i+=RULERS_GRADUATION_STEP) {
|
||||
if (i === 0) continue;
|
||||
for (let i = 0; i < size; i += RULERS_GRADUATION_STEP) {
|
||||
if (i === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
graduationLength = (i % 2 === 0) ? 6 : 4;
|
||||
|
||||
@ -2780,16 +2793,17 @@ RulersHighlighter.prototype = {
|
||||
}
|
||||
|
||||
if (isHorizontal) {
|
||||
if (i % RULERS_MARKER_STEP === 0)
|
||||
if (i % RULERS_MARKER_STEP === 0) {
|
||||
dMarkers += `M${i} 0 L${i} ${graduationLength}`;
|
||||
else
|
||||
} else {
|
||||
dGraduations += `M${i} 0 L${i} ${graduationLength} `;
|
||||
|
||||
}
|
||||
} else {
|
||||
if (i % 50 === 0)
|
||||
if (i % 50 === 0) {
|
||||
dMarkers += `M0 ${i} L${graduationLength} ${i}`;
|
||||
else
|
||||
} else {
|
||||
dGraduations += `M0 ${i} L${graduationLength} ${i}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2929,7 +2943,7 @@ SimpleOutlineHighlighter.prototype = {
|
||||
|
||||
function isNodeValid(node) {
|
||||
// Is it null or dead?
|
||||
if(!node || Cu.isDeadWrapper(node)) {
|
||||
if (!node || Cu.isDeadWrapper(node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2957,7 +2971,7 @@ function isNodeValid(node) {
|
||||
/**
|
||||
* Inject a helper stylesheet in the window.
|
||||
*/
|
||||
let installedHelperSheets = new WeakMap;
|
||||
let installedHelperSheets = new WeakMap();
|
||||
function installHelperSheet(win, source, type="agent") {
|
||||
if (installedHelperSheets.has(win.document)) {
|
||||
return;
|
||||
@ -3023,7 +3037,7 @@ function createNode(win, options) {
|
||||
for (let name in options.attributes || {}) {
|
||||
let value = options.attributes[name];
|
||||
if (options.prefix && (name === "class" || name === "id")) {
|
||||
value = options.prefix + value
|
||||
value = options.prefix + value;
|
||||
}
|
||||
node.setAttribute(name, value);
|
||||
}
|
||||
@ -3226,7 +3240,3 @@ HighlighterEnvironment.prototype = {
|
||||
this._win = null;
|
||||
}
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "DOMUtils", function() {
|
||||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
});
|
||||
|
@ -1,16 +1,15 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/* globals CssLogic, DOMUtils, CSS */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
const protocol = require("devtools/server/protocol");
|
||||
const {Arg, Option, method, RetVal, types} = protocol;
|
||||
const events = require("sdk/event/core");
|
||||
const object = require("sdk/util/object");
|
||||
const {Class} = require("sdk/core/heritage");
|
||||
const {LongStringActor} = require("devtools/server/actors/string");
|
||||
const {PSEUDO_ELEMENT_SET} = require("devtools/styleinspector/css-logic");
|
||||
@ -18,8 +17,12 @@ const {PSEUDO_ELEMENT_SET} = require("devtools/styleinspector/css-logic");
|
||||
// This will add the "stylesheet" actor type for protocol.js to recognize
|
||||
require("devtools/server/actors/stylesheets");
|
||||
|
||||
loader.lazyGetter(this, "CssLogic", () => require("devtools/styleinspector/css-logic").CssLogic);
|
||||
loader.lazyGetter(this, "DOMUtils", () => Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils));
|
||||
loader.lazyGetter(this, "CssLogic", () => {
|
||||
return require("devtools/styleinspector/css-logic").CssLogic;
|
||||
});
|
||||
loader.lazyGetter(this, "DOMUtils", () => {
|
||||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
});
|
||||
|
||||
// The PageStyle actor flattens the DOM CSS objects a little bit, merging
|
||||
// Rules and their Styles into one actor. For elements (which have a style
|
||||
@ -53,6 +56,8 @@ const FONT_PREVIEW_FONT_SIZE = 40;
|
||||
const FONT_PREVIEW_FILLSTYLE = "black";
|
||||
const NORMAL_FONT_WEIGHT = 400;
|
||||
const BOLD_FONT_WEIGHT = 700;
|
||||
// Offset (in px) to avoid cutting off text edges of italic fonts.
|
||||
const FONT_PREVIEW_OFFSET = 4;
|
||||
|
||||
// Predeclare the domnode actor type for use in requests.
|
||||
types.addActorType("domnode");
|
||||
@ -120,7 +125,7 @@ types.addDictType("fontface", {
|
||||
* The PageStyle actor lets the client look at the styles on a page, as
|
||||
* they are applied to a given node.
|
||||
*/
|
||||
var PageStyleActor = protocol.ActorClass({
|
||||
let PageStyleActor = protocol.ActorClass({
|
||||
typeName: "pagestyle",
|
||||
|
||||
/**
|
||||
@ -139,10 +144,10 @@ var PageStyleActor = protocol.ActorClass({
|
||||
"creating a PageStyleActor.");
|
||||
}
|
||||
this.walker = inspector.walker;
|
||||
this.cssLogic = new CssLogic;
|
||||
this.cssLogic = new CssLogic();
|
||||
|
||||
// Stores the association of DOM objects -> actors
|
||||
this.refMap = new Map;
|
||||
this.refMap = new Map();
|
||||
|
||||
this.onFrameUnload = this.onFrameUnload.bind(this);
|
||||
events.on(this.inspector.tabActor, "will-navigate", this.onFrameUnload);
|
||||
@ -229,7 +234,6 @@ var PageStyleActor = protocol.ActorClass({
|
||||
let computed = this.cssLogic.computedStyle || [];
|
||||
|
||||
Array.prototype.forEach.call(computed, name => {
|
||||
let matched = undefined;
|
||||
ret[name] = {
|
||||
value: computed.getPropertyValue(name),
|
||||
priority: computed.getPropertyPriority(name) || undefined
|
||||
@ -240,7 +244,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
let matched = this.cssLogic.hasMatchedSelectors(Object.keys(ret));
|
||||
for (let key in ret) {
|
||||
if (matched[key]) {
|
||||
ret[key].matched = options.markMatched ? true : undefined
|
||||
ret[key].matched = options.markMatched ? true : undefined;
|
||||
} else if (options.onlyMatched) {
|
||||
delete ret[key];
|
||||
}
|
||||
@ -274,13 +278,12 @@ var PageStyleActor = protocol.ActorClass({
|
||||
getAllUsedFontFaces: method(function(options) {
|
||||
let windows = this.inspector.tabActor.windows;
|
||||
let fontsList = [];
|
||||
for(let win of windows){
|
||||
for (let win of windows) {
|
||||
fontsList = [...fontsList,
|
||||
...this.getUsedFontFaces(win.document.body, options)];
|
||||
}
|
||||
return fontsList;
|
||||
},
|
||||
{
|
||||
}, {
|
||||
request: {
|
||||
includePreviews: Option(0, "boolean"),
|
||||
previewText: Option(0, "string"),
|
||||
@ -325,7 +328,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
format: font.format,
|
||||
localName: font.localName,
|
||||
metadata: font.metadata
|
||||
}
|
||||
};
|
||||
|
||||
// If this font comes from a @font-face rule
|
||||
if (font.rule) {
|
||||
@ -354,7 +357,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
previewFontSize: options.previewFontSize,
|
||||
fontStyle: weight + " " + style,
|
||||
fillStyle: options.previewFillStyle
|
||||
}
|
||||
};
|
||||
let { dataURL, size } = getFontPreviewData(font.CSSFamilyName,
|
||||
contentDocument, opts);
|
||||
fontFace.preview = {
|
||||
@ -436,10 +439,8 @@ var PageStyleActor = protocol.ActorClass({
|
||||
this.cssLogic.sourceFilter = options.filter || CssLogic.FILTER.UA;
|
||||
this.cssLogic.highlight(node.rawNode);
|
||||
|
||||
let walker = node.parent();
|
||||
|
||||
let rules = new Set;
|
||||
let sheets = new Set;
|
||||
let rules = new Set();
|
||||
let sheets = new Set();
|
||||
|
||||
let matched = [];
|
||||
let propInfo = this.cssLogic.getPropertyInfo(property);
|
||||
@ -465,7 +466,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
return {
|
||||
matched: matched,
|
||||
rules: [...rules],
|
||||
sheets: [...sheets],
|
||||
sheets: [...sheets]
|
||||
};
|
||||
}, {
|
||||
request: {
|
||||
@ -491,7 +492,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
} else {
|
||||
result = CssLogic.getShortName(source);
|
||||
}
|
||||
result += ".style"
|
||||
result += ".style";
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@ -557,7 +558,8 @@ var PageStyleActor = protocol.ActorClass({
|
||||
|
||||
let elementStyle = this._styleRef(bindingElement);
|
||||
let showElementStyles = !inherited && !pseudo;
|
||||
let showInheritedStyles = inherited && this._hasInheritedProps(bindingElement.style);
|
||||
let showInheritedStyles = inherited &&
|
||||
this._hasInheritedProps(bindingElement.style);
|
||||
|
||||
let rule = {
|
||||
rule: elementStyle,
|
||||
@ -580,7 +582,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
// Add normal rules. Typically this is passing in the node passed into the
|
||||
// function, unless if that node was ::before/::after. In which case,
|
||||
// it will pass in the parentNode along with "::before"/"::after".
|
||||
this._getElementRules(bindingElement, pseudo, inherited, options).forEach((rule) => {
|
||||
this._getElementRules(bindingElement, pseudo, inherited, options).forEach(rule => {
|
||||
// The only case when there would be a pseudo here is ::before/::after,
|
||||
// and in this case we want to tell the view that it belongs to the
|
||||
// element (which is a _moz_generated_content native anonymous element).
|
||||
@ -592,7 +594,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
// a 'normal rule' above.
|
||||
if (showElementStyles) {
|
||||
for (let pseudo of PSEUDO_ELEMENTS_TO_READ) {
|
||||
this._getElementRules(bindingElement, pseudo, inherited, options).forEach((rule) => {
|
||||
this._getElementRules(bindingElement, pseudo, inherited, options).forEach(rule => {
|
||||
rules.push(rule);
|
||||
});
|
||||
}
|
||||
@ -611,7 +613,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
*
|
||||
* @returns Array
|
||||
*/
|
||||
_getElementRules: function (node, pseudo, inherited, options) {
|
||||
_getElementRules: function(node, pseudo, inherited, options) {
|
||||
let domRules = DOMUtils.getCSSStyleRules(node, pseudo);
|
||||
if (!domRules) {
|
||||
return [];
|
||||
@ -692,7 +694,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
let selectors = CssLogic.getSelectors(domRule);
|
||||
let element = entry.inherited ? entry.inherited.rawNode : node.rawNode;
|
||||
|
||||
let {bindingElement,pseudo} = CssLogic.getBindingElementAndPseudo(element);
|
||||
let {bindingElement, pseudo} = CssLogic.getBindingElementAndPseudo(element);
|
||||
entry.matchedSelectors = [];
|
||||
for (let i = 0; i < selectors.length; i++) {
|
||||
if (DOMUtils.selectorMatchesElement(bindingElement, domRule, i, pseudo)) {
|
||||
@ -724,8 +726,8 @@ var PageStyleActor = protocol.ActorClass({
|
||||
}
|
||||
}
|
||||
|
||||
let rules = new Set;
|
||||
let sheets = new Set;
|
||||
let rules = new Set();
|
||||
let sheets = new Set();
|
||||
entries.forEach(entry => rules.add(entry.rule));
|
||||
this.expandSets(rules, sheets);
|
||||
|
||||
@ -733,7 +735,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
entries: entries,
|
||||
rules: [...rules],
|
||||
sheets: [...sheets]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
@ -807,9 +809,8 @@ var PageStyleActor = protocol.ActorClass({
|
||||
this.map[i].value = parseFloat(style.getPropertyValue(property));
|
||||
}
|
||||
|
||||
|
||||
if (options.margins) {
|
||||
layout.margins = this.processMargins(cssLogic);
|
||||
layout.margins = this.processMargins(this.cssLogic);
|
||||
}
|
||||
|
||||
return layout;
|
||||
@ -852,7 +853,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
get styleElement() {
|
||||
if (!this._styleElement) {
|
||||
let document = this.inspector.window.document;
|
||||
let style = document.createElementNS("http://www.w3.org/1999/xhtml", "style");
|
||||
let style = document.createElementNS(XHTML_NS, "style");
|
||||
style.setAttribute("type", "text/css");
|
||||
document.documentElement.appendChild(style);
|
||||
this._styleElement = style;
|
||||
@ -891,8 +892,7 @@ var PageStyleActor = protocol.ActorClass({
|
||||
if (rawNode.id) {
|
||||
selector = "#" + CSS.escape(rawNode.id);
|
||||
} else if (rawNode.className) {
|
||||
selector = "." +
|
||||
rawNode.className.split(" ").map(c => CSS.escape(c)).join(".");
|
||||
selector = "." + [...rawNode.classList].map(c => CSS.escape(c)).join(".");
|
||||
} else {
|
||||
selector = rawNode.tagName.toLowerCase();
|
||||
}
|
||||
@ -916,7 +916,7 @@ exports.PageStyleActor = PageStyleActor;
|
||||
/**
|
||||
* Front object for the PageStyleActor
|
||||
*/
|
||||
var PageStyleFront = protocol.FrontClass(PageStyleActor, {
|
||||
let PageStyleFront = protocol.FrontClass(PageStyleActor, {
|
||||
initialize: function(conn, form, ctx, detail) {
|
||||
protocol.Front.prototype.initialize.call(this, conn, form, ctx, detail);
|
||||
this.inspector = this.parent();
|
||||
@ -977,7 +977,7 @@ var PageStyleFront = protocol.FrontClass(PageStyleActor, {
|
||||
* (which have a CSSStyle but no CSSRule) we create a StyleRuleActor
|
||||
* with a special rule type (100).
|
||||
*/
|
||||
var StyleRuleActor = protocol.ActorClass({
|
||||
let StyleRuleActor = protocol.ActorClass({
|
||||
typeName: "domstylerule",
|
||||
initialize: function(pageStyle, item) {
|
||||
protocol.Actor.prototype.initialize.call(this, null);
|
||||
@ -999,8 +999,10 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
this.rawNode = item;
|
||||
this.rawRule = {
|
||||
style: item.style,
|
||||
toString: function() { return "[element rule " + this.style + "]"; }
|
||||
}
|
||||
toString: function() {
|
||||
return "[element rule " + this.style + "]";
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
@ -1026,7 +1028,9 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
return document;
|
||||
},
|
||||
|
||||
toString: function() { return "[StyleRuleActor for " + this.rawRule + "]" },
|
||||
toString: function() {
|
||||
return "[StyleRuleActor for " + this.rawRule + "]"
|
||||
},
|
||||
|
||||
form: function(detail) {
|
||||
if (detail === "actorid") {
|
||||
@ -1112,10 +1116,9 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
* @returns the rule with updated properties
|
||||
*/
|
||||
modifyProperties: method(function(modifications) {
|
||||
let validProps = new Map();
|
||||
|
||||
// Use a fresh element for each call to this function to prevent side effects
|
||||
// that pop up based on property values that were already set on the element.
|
||||
// Use a fresh element for each call to this function to prevent side
|
||||
// effects that pop up based on property values that were already set on the
|
||||
// element.
|
||||
|
||||
let document;
|
||||
if (this.rawNode) {
|
||||
@ -1176,7 +1179,10 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
parentStyleSheet.insertRule(value + " " + ruleText, i);
|
||||
parentStyleSheet.deleteRule(i + 1);
|
||||
return cssRules.item(i);
|
||||
} catch(e) {}
|
||||
} catch(e) {
|
||||
// The selector could be invalid, or the rule could fail to insert.
|
||||
// If that happens, the method returns null.
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -1219,9 +1225,8 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
if (selectorElement && this.rawRule.selectorText !== value) {
|
||||
this._addNewSelector(value);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}, {
|
||||
request: { selector: Arg(0, "string") },
|
||||
response: { isModified: RetVal("boolean") },
|
||||
@ -1263,7 +1268,9 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
// Determine if the new selector value matches the current selected element
|
||||
try {
|
||||
isMatching = node.rawNode.matches(value);
|
||||
} catch(e) {}
|
||||
} catch(e) {
|
||||
// This fails when value is an invalid selector.
|
||||
}
|
||||
|
||||
return { ruleProps, isMatching };
|
||||
}, {
|
||||
@ -1278,7 +1285,7 @@ var StyleRuleActor = protocol.ActorClass({
|
||||
/**
|
||||
* Front for the StyleRule actor.
|
||||
*/
|
||||
var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
let StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
initialize: function(client, form, ctx, detail) {
|
||||
protocol.Front.prototype.initialize.call(this, client, form, ctx, detail);
|
||||
},
|
||||
@ -1370,8 +1377,7 @@ var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
return this._form.traits && this._form.traits.modifySelectorUnmatched;
|
||||
},
|
||||
|
||||
get location()
|
||||
{
|
||||
get location() {
|
||||
return {
|
||||
source: this.parentStyleSheet,
|
||||
href: this.href,
|
||||
@ -1380,8 +1386,7 @@ var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
};
|
||||
},
|
||||
|
||||
getOriginalLocation: function()
|
||||
{
|
||||
getOriginalLocation: function() {
|
||||
if (this._originalLocation) {
|
||||
return promise.resolve(this._originalLocation);
|
||||
}
|
||||
@ -1432,7 +1437,7 @@ var StyleRuleFront = protocol.FrontClass(StyleRuleActor, {
|
||||
* Convenience API for building a list of attribute modifications
|
||||
* for the `modifyAttributes` request.
|
||||
*/
|
||||
var RuleModificationList = Class({
|
||||
let RuleModificationList = Class({
|
||||
initialize: function(rule) {
|
||||
this.rule = rule;
|
||||
this.modifications = [];
|
||||
@ -1485,8 +1490,8 @@ function getFontPreviewData(font, doc, options) {
|
||||
ctx.font = fontValue;
|
||||
ctx.fillStyle = fillStyle;
|
||||
let textWidth = ctx.measureText(previewText).width;
|
||||
let offset = 4; // offset to avoid cutting off text edge of italics
|
||||
canvas.width = textWidth * 2 + offset * 2;
|
||||
|
||||
canvas.width = textWidth * 2 + FONT_PREVIEW_OFFSET * 2;
|
||||
canvas.height = previewFontSize * 3;
|
||||
|
||||
// we have to reset these after changing the canvas size
|
||||
@ -1496,13 +1501,15 @@ function getFontPreviewData(font, doc, options) {
|
||||
// Oversample the canvas for better text quality
|
||||
ctx.textBaseline = "top";
|
||||
ctx.scale(2, 2);
|
||||
ctx.fillText(previewText, offset, Math.round(previewFontSize / 3));
|
||||
ctx.fillText(previewText,
|
||||
FONT_PREVIEW_OFFSET,
|
||||
Math.round(previewFontSize / 3));
|
||||
|
||||
let dataURL = canvas.toDataURL("image/png");
|
||||
|
||||
return {
|
||||
dataURL: dataURL,
|
||||
size: textWidth + offset * 2
|
||||
size: textWidth + FONT_PREVIEW_OFFSET * 2
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -182,9 +182,6 @@ let Timeline = exports.Timeline = Class({
|
||||
*/
|
||||
start: Task.async(function *({ withMemory, withTicks }) {
|
||||
let startTime = this._startTime = this.docShells[0].now();
|
||||
// Store the start time from unix epoch so we can normalize
|
||||
// markers from the memory actor
|
||||
this._unixStartTime = Date.now();
|
||||
|
||||
if (this._isRecording) {
|
||||
return startTime;
|
||||
@ -266,9 +263,6 @@ let Timeline = exports.Timeline = Class({
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalize the start time to docshell start time, and convert it
|
||||
// to microseconds.
|
||||
let startTime = (this._unixStartTime - this._startTime) * 1000;
|
||||
let endTime = this.docShells[0].now();
|
||||
|
||||
events.emit(this, "markers", collections.map(({ startTimestamp: start, endTimestamp: end }) => {
|
||||
@ -277,8 +271,8 @@ let Timeline = exports.Timeline = Class({
|
||||
causeName: reason,
|
||||
nonincrementalReason: nonincrementalReason,
|
||||
// Both timestamps are in microseconds -- convert to milliseconds to match other markers
|
||||
start: (start - startTime) / 1000,
|
||||
end: (end - startTime) / 1000
|
||||
start: start,
|
||||
end: end
|
||||
};
|
||||
}), endTime);
|
||||
},
|
||||
|
@ -14,9 +14,9 @@
|
||||
]>
|
||||
|
||||
<dialog id="changemp" title="&setPassword.title;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="width: 35em;"
|
||||
ondialogaccept="setPassword();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="width: 40em;"
|
||||
ondialogaccept="setPassword();"
|
||||
onload="init()">
|
||||
|
||||
<script type="application/javascript" src="chrome://mozapps/content/preferences/changemp.js"/>
|
||||
@ -28,30 +28,30 @@
|
||||
<groupbox>
|
||||
<grid>
|
||||
<columns>
|
||||
<column flex="1"/>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label control="oldpw" value="&setPassword.oldPassword.label;"/>
|
||||
<label control="oldpw">&setPassword.oldPassword.label;</label>
|
||||
<textbox id="oldpw" type="password"/>
|
||||
<!-- This textbox is inserted as a workaround to the fact that making the 'type'
|
||||
& 'disabled' property of the 'oldpw' textbox toggle between ['password' &
|
||||
'false'] and ['text' & 'true'] - as would be necessary if the menu has more
|
||||
than one tokens, some initialized and some not - does not work properly. So,
|
||||
either the textbox 'oldpw' or the textbox 'message' would be displayed,
|
||||
depending on the state of the token selected
|
||||
<!-- This textbox is inserted as a workaround to the fact that making the 'type'
|
||||
& 'disabled' property of the 'oldpw' textbox toggle between ['password' &
|
||||
'false'] and ['text' & 'true'] - as would be necessary if the menu has more
|
||||
than one tokens, some initialized and some not - does not work properly. So,
|
||||
either the textbox 'oldpw' or the textbox 'message' would be displayed,
|
||||
depending on the state of the token selected
|
||||
-->
|
||||
<textbox id="message" disabled="true" />
|
||||
</row>
|
||||
<row>
|
||||
<label control="pw1" value="&setPassword.newPassword.label;"/>
|
||||
<textbox id="pw1" type="password"
|
||||
oninput="setPasswordStrength(); checkPasswords();"/>
|
||||
<label control="pw1">&setPassword.newPassword.label;</label>
|
||||
<textbox id="pw1" type="password"
|
||||
oninput="setPasswordStrength(); checkPasswords();"/>
|
||||
</row>
|
||||
<row>
|
||||
<label control="pw2" value="&setPassword.reenterPassword.label;"/>
|
||||
<textbox id="pw2" type="password" oninput="checkPasswords();"/>
|
||||
<label control="pw2">&setPassword.reenterPassword.label;</label>
|
||||
<textbox id="pw2" type="password" oninput="checkPasswords();"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
Loading…
Reference in New Issue
Block a user