Skip to content

Commit 78cd372

Browse files
committed
Update generated files
1 parent 188523e commit 78cd372

File tree

3 files changed

+172
-138
lines changed

3 files changed

+172
-138
lines changed

outlib/Session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Session = function (_React$Component) {_inherits(Session, _React$Component);
154154
window.close();
155155
} else {
156156
setTimeout(function () {
157-
this.props.scrollTo("window", newWindow.id);
157+
this.props.scrollTo("window", browser.windows.WINDOW_ID_CURRENT);
158158
}.bind(this), 250);
159159
}
160160

outlib/Tab.js

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
1919
}_createClass(Tab, [{ key: "componentWillMount", value: function componentWillMount()
2020
{
2121
this.resolveFavIconUrl();
22+
} }, { key: "componentDidUpdate", value: function componentDidUpdate(
23+
prevProps, prevState) {
24+
if (this.props.tab.favIconUrl != prevProps.tab.favIconUrl) {
25+
this.resolveFavIconUrl();
26+
}
2227
} }, { key: "render", value: function render()
2328
{
2429
var children = [];
@@ -138,8 +143,9 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
138143

139144
e) {
140145
if (!!this.props.drag) {
146+
var url = this.props.tab.url || this.props.tab.pendingUrl;
141147
e.dataTransfer.setData("Text", this.props.tab.id);
142-
e.dataTransfer.setData("text/uri-list", this.props.tab.url || "");
148+
e.dataTransfer.setData("text/uri-list", url || "");
143149
this.props.drag(e, this.props.tab.id);
144150
} else {
145151
return false;
@@ -170,40 +176,42 @@ Tab = function (_React$Component) {_inherits(Tab, _React$Component);
170176
} else {
171177
return false;
172178
}
173-
} }, { key: "resolveFavIconUrl", value: function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {var image, favIcons, iconUrl, iconName;return regeneratorRuntime.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
174-
175-
176-
// firefox screenshots; needs <all_urls>
177-
// if(!!browser.tabs.captureTab) {
178-
// console.log("tabs captureTab");
179-
// image = await browser.tabs.captureTab(this.props.tab.id);
180-
// image = "url(" + image + ")";
181-
// }else
182-
if (!!this.props.tab.url && this.props.tab.url.indexOf("chrome://") !== 0 && this.props.tab.url.indexOf("about:") !== 0) {
183-
// chrome screenshots / only for active tabs; needs <all_urls>
184-
// if(!!browser.tabs.captureVisibleTab && this.props.tab.highlighted) {
185-
// console.log("tabsCapture");
186-
// try {
187-
// image = await browser.tabs.captureVisibleTab( this.props.window.id, {} );
188-
// //console.log(image);
189-
// } catch ( e ) {
190-
// console.log(e.message);
191-
// }
192-
// image = "url(" + image + ")";
193-
// }else{
194-
image = this.props.tab.favIconUrl ? "url(" + this.props.tab.favIconUrl + ")" : "";
195-
//}
196-
} else {
197-
favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"];
198-
iconUrl = this.props.tab.url || "";
199-
iconName = "";
200-
if (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\w+/g);
201-
image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "url(../images/chrome/" + iconName[0] + ".png)";
202-
}
203-
this.setState({
204-
favIcon: image });case 2:case "end":return _context2.stop();}}}, _callee2, this);}));function resolveFavIconUrl() {return _ref2.apply(this, arguments);}return resolveFavIconUrl;}() }, { key: "stopProp", value: function stopProp(
205-
179+
} }, { key: "resolveFavIconUrl", value: function resolveFavIconUrl()
180+
{
181+
var image;
182+
// firefox screenshots; needs <all_urls>
183+
// if(!!browser.tabs.captureTab) {
184+
// console.log("tabs captureTab");
185+
// image = await browser.tabs.captureTab(this.props.tab.id);
186+
// image = "url(" + image + ")";
187+
// }else
188+
var url = this.props.tab.url || this.props.tab.pendingUrl;
189+
if (!!url && url.indexOf("chrome://") !== 0 && url.indexOf("about:") !== 0) {
190+
// chrome screenshots / only for active tabs; needs <all_urls>
191+
// if(!!browser.tabs.captureVisibleTab && this.props.tab.highlighted) {
192+
// console.log("tabsCapture");
193+
// try {
194+
// image = await browser.tabs.captureVisibleTab( this.props.window.id, {} );
195+
// //console.log(image);
196+
// } catch ( e ) {
197+
// console.log(e.message);
198+
// }
199+
// image = "url(" + image + ")";
200+
// }else{
201+
image = this.props.tab.favIconUrl ? "url(" + this.props.tab.favIconUrl + ")" : "";
202+
//}
203+
} else {
204+
var favIcons = ["bookmarks", "chrome", "crashes", "downloads", "extensions", "flags", "history", "settings"];
205+
var iconUrl = url || "";
206+
var iconName = "";
207+
if (iconUrl.length > 9) iconName = iconUrl.slice(9).match(/^\w+/g);
208+
image = !iconName || favIcons.indexOf(iconName[0]) < 0 ? "" : "url(../images/chrome/" + iconName[0] + ".png)";
209+
}
210+
if (this.state.favIcon == image) return;
211+
this.setState({
212+
favIcon: image });
206213

214+
} }, { key: "stopProp", value: function stopProp(
207215
e) {
208216
if (e && e.nativeEvent) {
209217
e.nativeEvent.preventDefault();

0 commit comments

Comments
 (0)