mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-02 00:42:45 +01:00
Merge branch 'master' of github.com:gorhill/uBlock
This commit is contained in:
commit
6e27db557f
@ -153,13 +153,24 @@ const contentObserver = {
|
|||||||
// so check context.top instead of context
|
// so check context.top instead of context
|
||||||
if ( context.top && context.location ) {
|
if ( context.top && context.location ) {
|
||||||
// https://bugzil.la/1092216
|
// https://bugzil.la/1092216
|
||||||
getMessageManager(context).sendRpcMessage(this.cpMessageName, {
|
let messageManager = getMessageManager(context);
|
||||||
|
let details = {
|
||||||
openerURL: openerURL || null,
|
openerURL: openerURL || null,
|
||||||
url: location.spec,
|
url: location.spec,
|
||||||
type: type,
|
type: type,
|
||||||
frameId: type === this.MAIN_FRAME ? -1 : (context === context.top ? 0 : 1),
|
frameId: type === this.MAIN_FRAME ? -1 : (context === context.top ? 0 : 1),
|
||||||
parentFrameId: context === context.top ? -1 : 0
|
parentFrameId: context === context.top ? -1 : 0
|
||||||
});
|
};
|
||||||
|
|
||||||
|
// TODO: frameId from outerWindowID?
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindowUtils
|
||||||
|
|
||||||
|
if ( typeof messageManager.sendRpcMessage === 'function' ) {
|
||||||
|
messageManager.sendRpcMessage(this.cpMessageName, details);
|
||||||
|
} else {
|
||||||
|
// Compatibility for older versions
|
||||||
|
messageManager.sendSyncMessage(this.cpMessageName, details);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.ACCEPT;
|
return this.ACCEPT;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<targetApplication>
|
<targetApplication>
|
||||||
<r:Description>
|
<r:Description>
|
||||||
<id>{{ec8030f7-c20a-464f-9b0e-13a3a9e97384}}</id>
|
<id>{{ec8030f7-c20a-464f-9b0e-13a3a9e97384}}</id>
|
||||||
<minVersion>29.0</minVersion>
|
<minVersion>24.0</minVersion>
|
||||||
<maxVersion>38.0</maxVersion>
|
<maxVersion>38.0</maxVersion>
|
||||||
</r:Description>
|
</r:Description>
|
||||||
</targetApplication>
|
</targetApplication>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<targetApplication>
|
<targetApplication>
|
||||||
<r:Description>
|
<r:Description>
|
||||||
<id>{{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}}</id>
|
<id>{{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}}</id>
|
||||||
<minVersion>2.26</minVersion>
|
<minVersion>2.21</minVersion>
|
||||||
<maxVersion>2.35</maxVersion>
|
<maxVersion>2.35</maxVersion>
|
||||||
</r:Description>
|
</r:Description>
|
||||||
</targetApplication>
|
</targetApplication>
|
||||||
|
@ -45,7 +45,7 @@ vAPI.firefox = true;
|
|||||||
// TODO: read these data from somewhere...
|
// TODO: read these data from somewhere...
|
||||||
vAPI.app = {
|
vAPI.app = {
|
||||||
name: 'µBlock',
|
name: 'µBlock',
|
||||||
version: '0.8.5.3'
|
version: '0.8.5.4'
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -366,7 +366,7 @@ vAPI.tabs.registerListeners = function() {
|
|||||||
|
|
||||||
vAPI.tabs.getTabId = function(target) {
|
vAPI.tabs.getTabId = function(target) {
|
||||||
if ( target.linkedPanel ) {
|
if ( target.linkedPanel ) {
|
||||||
return target.linkedPanel.slice(6);
|
return target.linkedPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
var i, gBrowser = target.ownerDocument.defaultView.gBrowser;
|
var i, gBrowser = target.ownerDocument.defaultView.gBrowser;
|
||||||
@ -374,13 +374,13 @@ vAPI.tabs.getTabId = function(target) {
|
|||||||
// This should be more efficient from version 35
|
// This should be more efficient from version 35
|
||||||
if ( gBrowser.getTabForBrowser ) {
|
if ( gBrowser.getTabForBrowser ) {
|
||||||
i = gBrowser.getTabForBrowser(target);
|
i = gBrowser.getTabForBrowser(target);
|
||||||
return i ? i.linkedPanel.slice(6) : -1;
|
return i ? i.linkedPanel : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = gBrowser.browsers.indexOf(target);
|
i = gBrowser.browsers.indexOf(target);
|
||||||
|
|
||||||
if ( i !== -1 ) {
|
if ( i !== -1 ) {
|
||||||
i = gBrowser.tabs[i].linkedPanel.slice(6);
|
i = gBrowser.tabs[i].linkedPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
@ -399,7 +399,7 @@ vAPI.tabs.get = function(tabId, callback) {
|
|||||||
|
|
||||||
for ( var win of windows ) {
|
for ( var win of windows ) {
|
||||||
tab = win.gBrowser.tabContainer.querySelector(
|
tab = win.gBrowser.tabContainer.querySelector(
|
||||||
'tab[linkedpanel="panel-' + tabId + '"]'
|
'tab[linkedpanel="' + tabId + '"]'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( tab ) {
|
if ( tab ) {
|
||||||
@ -541,7 +541,7 @@ vAPI.tabs.remove = function(tabIds) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tabIds = tabIds.map(function(tabId) {
|
tabIds = tabIds.map(function(tabId) {
|
||||||
return 'tab[linkedpanel="panel-' + tabId + '"]';
|
return 'tab[linkedpanel="' + tabId + '"]';
|
||||||
}).join(',');
|
}).join(',');
|
||||||
|
|
||||||
for ( var win of this.getWindows() ) {
|
for ( var win of this.getWindows() ) {
|
||||||
@ -580,6 +580,7 @@ vAPI.tabs.injectScript = function(tabId, details, callback) {
|
|||||||
details.file = vAPI.getURL(details.file);
|
details.file = vAPI.getURL(details.file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tab.linkedBrowser.messageManager.sendAsyncMessage(
|
tab.linkedBrowser.messageManager.sendAsyncMessage(
|
||||||
location.host + ':broadcast',
|
location.host + ':broadcast',
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@ -1135,7 +1136,12 @@ vAPI.toolbarButton = {
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
vAPI.toolbarButton.init = function() {
|
vAPI.toolbarButton.init = function() {
|
||||||
var {CustomizableUI} = Cu.import('resource:///modules/CustomizableUI.jsm', null);
|
try {
|
||||||
|
var {CustomizableUI} = Cu.import('resource:///modules/CustomizableUI.jsm', null);
|
||||||
|
} catch (ex) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.defaultArea = CustomizableUI.AREA_NAVBAR;
|
this.defaultArea = CustomizableUI.AREA_NAVBAR;
|
||||||
this.styleURI = [
|
this.styleURI = [
|
||||||
'#' + this.id + ' {',
|
'#' + this.id + ' {',
|
||||||
@ -1418,15 +1424,23 @@ vAPI.contextMenu.create = function(details, callback) {
|
|||||||
this.onCommand = function() {
|
this.onCommand = function() {
|
||||||
var gContextMenu = this.ownerDocument.defaultView.gContextMenu;
|
var gContextMenu = this.ownerDocument.defaultView.gContextMenu;
|
||||||
var details = {
|
var details = {
|
||||||
menuItemId: this.id,
|
menuItemId: this.id
|
||||||
tagName: gContextMenu.target.tagName.toLowerCase()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( gContextMenu.inFrame ) {
|
if ( gContextMenu.inFrame ) {
|
||||||
|
details.tagName = 'iframe';
|
||||||
details.frameUrl = gContextMenu.focusedWindow.location.href;
|
details.frameUrl = gContextMenu.focusedWindow.location.href;
|
||||||
} else if ( gContextMenu.onImage || gContextMenu.onAudio || gContextMenu.onVideo ) {
|
} else if ( gContextMenu.onImage ) {
|
||||||
|
details.tagName = 'img';
|
||||||
|
details.srcUrl = gContextMenu.mediaURL;
|
||||||
|
} else if ( gContextMenu.onAudio ) {
|
||||||
|
details.tagName = 'audio';
|
||||||
|
details.srcUrl = gContextMenu.mediaURL;
|
||||||
|
} else if ( gContextMenu.onVideo ) {
|
||||||
|
details.tagName = 'video';
|
||||||
details.srcUrl = gContextMenu.mediaURL;
|
details.srcUrl = gContextMenu.mediaURL;
|
||||||
} else if ( gContextMenu.onLink ) {
|
} else if ( gContextMenu.onLink ) {
|
||||||
|
details.tagName = 'a';
|
||||||
details.linkUrl = gContextMenu.linkURL;
|
details.linkUrl = gContextMenu.linkURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,4 +65,5 @@ iframe {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-top: 50px solid transparent;
|
border-top: 50px solid transparent;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
body {
|
body {
|
||||||
border: 0;
|
border: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
font: 12px monospace;
|
font: 12px monospace;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
@ -8,6 +8,7 @@ body {
|
|||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
border: none;
|
border: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
height: 4em;
|
height: 4em;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -41,6 +42,7 @@ select option {
|
|||||||
#content {
|
#content {
|
||||||
border: 0;
|
border: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
height: calc(100vh - 4em);
|
height: calc(100vh - 4em);
|
||||||
margin-top: 4em;
|
margin-top: 4em;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -192,6 +192,7 @@ body.dirty #refresh:hover {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
color: #000;
|
color: #000;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
|
Loading…
Reference in New Issue
Block a user