Bug 1305777 - Move RDM frame script to new RDM. r=ochameau
MozReview-Commit-ID: LJhKdurBVzt
rename from devtools/client/responsivedesign/responsivedesign-child.js
rename to devtools/client/responsive.html/browser/content.js
--- a/devtools/client/responsive.html/browser/moz.build
+++ b/devtools/client/responsive.html/browser/moz.build
@@ -1,11 +1,12 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
DevToolsModules(
+ 'content.js',
'swap.js',
'tunnel.js',
'web-navigation.js',
)
--- a/devtools/client/responsive.html/components/browser.js
+++ b/devtools/client/responsive.html/components/browser.js
@@ -10,16 +10,18 @@ const { Task } = require("devtools/share
const flags = require("devtools/shared/flags");
const { getToplevelWindow } = require("../utils/window");
const { DOM: dom, createClass, addons, PropTypes } =
require("devtools/client/shared/vendor/react");
const e10s = require("../utils/e10s");
const message = require("../utils/message");
+const FRAME_SCRIPT = "resource://devtools/client/responsive.html/browser/content.js";
+
module.exports = createClass({
/**
* This component is not allowed to depend directly on frequently changing
* data (width, height) due to the use of `dangerouslySetInnerHTML` below.
* Any changes in props will cause the <iframe> to be removed and added again,
* throwing away the current state of the page.
*/
@@ -78,18 +80,17 @@ module.exports = createClass({
// Notify tests when the content has received a resize event. This is not
// quite the same timing as when we _set_ a new size around the browser,
// since it still needs to do async work before the content is actually
// resized to match.
e10s.on(mm, "OnContentResize", onContentResize);
let ready = e10s.once(mm, "ChildScriptReady");
- mm.loadFrameScript("resource://devtools/client/responsivedesign/" +
- "responsivedesign-child.js", true);
+ mm.loadFrameScript(FRAME_SCRIPT, true);
yield ready;
let browserWindow = getToplevelWindow(window);
let requiresFloatingScrollbars =
!browserWindow.matchMedia("(-moz-overlay-scrollbars)").matches;
yield e10s.request(mm, "Start", {
requiresFloatingScrollbars,
--- a/devtools/client/responsive.html/utils/e10s.js
+++ b/devtools/client/responsive.html/utils/e10s.js
@@ -1,16 +1,16 @@
/* 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/. */
"use strict";
// The prefix used for RDM messages in content.
-// see: devtools/client/responsivedesign/responsivedesign-child.js
+// see: devtools/client/responsive.html/browser/content.js
const MESSAGE_PREFIX = "ResponsiveMode:";
const REQUEST_DONE_SUFFIX = ":Done";
/**
* Registers a message `listener` that is called every time messages of
* specified `message` is emitted on the given message manager.
* @param {nsIMessageListenerManager} mm
* The Message Manager
--- a/devtools/client/responsivedesign/moz.build
+++ b/devtools/client/responsivedesign/moz.build
@@ -1,15 +1,14 @@
# 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/.
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
DevToolsModules(
'resize-commands.js',
- 'responsivedesign-child.js',
'responsivedesign-old.js',
'responsivedesign.js',
)
-with Files('**'):
- BUG_COMPONENT = ('Firefox', 'Developer Tools: Responsive Design Mode')
+with Files('**'):
+ BUG_COMPONENT = ('Firefox', 'Developer Tools: Responsive Design Mode')
--- a/devtools/client/responsivedesign/responsivedesign-old.js
+++ b/devtools/client/responsivedesign/responsivedesign-old.js
@@ -204,17 +204,17 @@ ResponsiveUI.prototype = {
} else if (!value) {
this.stack.setAttribute("notransition", "true");
}
},
init: Task.async(function* () {
debug("INIT BEGINS");
let ready = this.waitForMessage("ResponsiveMode:ChildScriptReady");
- this.mm.loadFrameScript("resource://devtools/client/responsivedesign/responsivedesign-child.js", true);
+ this.mm.loadFrameScript("resource://devtools/client/responsive.html/browser/content.js", true);
yield ready;
yield gDevToolsBrowser.loadBrowserStyleSheet(this.mainWindow);
let requiresFloatingScrollbars =
!this.mainWindow.matchMedia("(-moz-overlay-scrollbars)").matches;
let started = this.waitForMessage("ResponsiveMode:Start:Done");
debug("SEND START");