1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-09-11 23:15:36 +12:00
Commit graph

288 commits

Author SHA1 Message Date
Deathamns
54868d149a Initial Firefox port (base, messaging, locales) 2015-04-13 08:37:35 -04:00
Deathamns
08403a44f8 Implement vAPI.insertHTML
The purpose of this API is basically to satisfy AMO reviewers in the
future, since the use of innerHTML with variables (i.e., not plain text) will
be rejected without any questions.

Since this is not a problem for browsers other than Firefox, they will
use simple innerHTML assignment, however safe-parsing could be implemented
for them too.
2015-04-13 08:35:57 -04:00
Deathamns
bbfcb4eea9 abp:subscribe fixes
Test a[href^="abp:"], since the protocol probably not used for anything
else, also "a", because ABP checks only anchors, and these links are made
only for ABP.

Also, the event target is not always the link, so at least some parents
should be tested as well.
2015-04-13 08:35:51 -04:00
Deathamns
aff7501596 Firefox: different kind of vAPI.localStorage 2015-04-13 08:35:51 -04:00
Deathamns
10f364c153 Firefox,Safari: vAPI.localStorage 2015-04-13 08:35:51 -04:00
gorhill
c80280bd2d this fixes #792 2015-04-13 08:35:51 -04:00
Deathamns
c9b1298344 Remove unnecessary fallback code for downloading 2015-04-13 08:35:51 -04:00
gorhill
c6e3b5a81b Firefox: oops 2015-04-13 08:35:51 -04:00
gorhill
3e43478e13 changes re #993 for firefox platform 2015-04-13 08:35:51 -04:00
Deathamns
829f80e1da Fix prorblems caused by vAPI.insertHTML 2015-04-13 08:35:51 -04:00
Deathamns
618502354f Implement vAPI.insertHTML
The purpose of this API is basically to satisfy AMO reviewers in the
future, since the use of innerHTML with variables (i.e., not plain text) will
be rejected without any questions.

Since this is not a problem for browsers other than Firefox, they will
use simple innerHTML assignment, however safe-parsing could be implemented
for them too.
2015-04-13 08:35:51 -04:00
Deathamns
e2c0beb663 Miscellaneous changes 2015-04-13 08:35:51 -04:00
Deathamns
3dc8e88c75 Popup related changes 2015-04-13 08:35:51 -04:00
Deathamns
9cb78c2575 Add license headers, plus some code styling 2015-04-13 08:35:51 -04:00
Deathamns
7c69a427c2 Firefox: implement toolbar button and popup 2015-04-13 08:35:51 -04:00
Deathamns
799aafbcd4 Firefox: implement vAPI.storage via SQLite 2015-04-13 08:35:51 -04:00
Deathamns
e98b514a51 Initial Firefox port (base, messaging, locales) 2015-04-13 08:35:51 -04:00
gorhill
db49291fa6 this fixes https://github.com/chrisaljoudi/uBlock/issues/1219 for Firefox 2015-04-13 08:35:45 -04:00
gorhill
2fbca2cc09 forgot to add shutdown to other platforms (re. https://github.com/gorhill/uMatrix/issues/144) 2015-04-13 08:35:45 -04:00
Deathamns
afaf6aff9b vAPI.sessionId, element-picker dialog as iframe
vAPI.sessionId - random ID generated every time when a page loads.

Having the dialog in an iframe lowers the chance of interference with the
styling of the page, also avoids using innerHTML (AMO complaint).
2015-04-13 08:35:45 -04:00
Chris
0fbaf41d09 Remove previous Safari overhead; cleanup workarounds from rest of code 2015-04-13 08:35:45 -04:00
Deathamns
4b3d6716ff Firefox: remove evalInSandbox
Probably we won't eval plain text code, which makes it unnecessary, also
this way the validator on AMO won't complain about it.
2015-04-13 08:35:45 -04:00
Deathamns
f196d31a2f Firefox: behind-the-scene requests / non-http tabs 2015-04-13 08:35:45 -04:00
gorhill
995236c6a9 not needed 2015-04-13 08:35:45 -04:00
Deathamns
a7f15f0b71 URL handling changes 2015-04-13 08:35:45 -04:00
Deathamns
a6acb50892 Firefox: fixed content scripts? 2015-04-13 08:35:45 -04:00
Deathamns
5f92ce4599 Firefox: improvements for content scripts 2015-04-13 08:35:45 -04:00
Deathamns
1a1d1b1c4b Code styling 2015-04-13 08:35:45 -04:00
Deathamns
3e39e1bd9f Firefox: new method for request handling
Now both nsIContentPolicy and on-http-* observers are used for net request
monitoring.

Reasons:
 - In many cases, nsIContentPolicy.shouldLoad is invoked twice for the same
   resource, because of the speculative parsing.
 - nsIContentPolicy.shouldLoad don't have information about the channel,
   so it can't redirect the request, nor change its headers, however
   on-http-opening-request can.

Also, local mirroring and inline-script blocking has been implemented.
2015-04-13 08:35:45 -04:00
Deathamns
e70bf61206 Add license headers, plus some code styling 2015-04-13 08:35:45 -04:00
Deathamns
1ae15f1a61 Firefox: implement vAPI.tabs.injectScript 2015-04-13 08:35:45 -04:00
Deathamns
747f6f9955 Firefox: implement toolbar button and popup 2015-04-13 08:35:45 -04:00
Deathamns
e96e535f3d Firefox: add basic blocking + some fixes 2015-04-13 08:35:45 -04:00
Deathamns
dd6f3cc4b3 Firefox: partial vAPI.tabs implementation 2015-04-13 08:35:45 -04:00
Deathamns
8f0cf1d340 Initial Firefox port (base, messaging, locales) 2015-04-13 08:35:45 -04:00
AlexVallat
cc85464eb5 Tidying .xul location, update linux script to match windows one 2015-04-13 08:35:19 -04:00
gorhill
e4688ecf22 this fixes https://github.com/chrisaljoudi/uBlock/issues/1219 for Firefox 2015-04-13 08:35:08 -04:00
Deathamns
2b365ec4c1 Firefox: update application versions 2015-04-13 08:35:04 -04:00
AlexVallat
15df6b8e4f Initial UI support for Fennec 2015-04-13 08:35:04 -04:00
Deathamns
6812ed591a Firefox/Fennec code cleanup 2015-04-13 08:35:04 -04:00
Cheng Sun
cce2e85eeb Fennec WIP #2 2015-04-13 08:35:04 -04:00
Deathamns
0397ea0eac Remove unused code 2015-04-13 08:35:04 -04:00
Deathamns
ab0b1936b4 Firefox: get the version number from the fragment 2015-04-13 08:35:04 -04:00
Deathamns
ad19bae5e1 Firefox: add localized descriptions to install.rdf 2015-04-13 08:35:04 -04:00
Deathamns
2f7be81668 Firefox: minimal effort to support older versions 2015-04-13 08:35:04 -04:00
Deathamns
839c6300b8 Miscellaneous changes 2015-04-13 08:35:04 -04:00
Deathamns
8b01ed93ed Firefox: update manifest files when building 2015-04-13 08:35:04 -04:00
Deathamns
2750dac88c Firefox: implement toolbar button and popup 2015-04-13 08:35:04 -04:00
Deathamns
691c261118 Firefox: partial vAPI.tabs implementation 2015-04-13 08:35:04 -04:00
Deathamns
ee210ad15c Firefox: implement vAPI.storage via SQLite 2015-04-13 08:35:04 -04:00
Deathamns
91ad0d65a8 Initial Firefox port (base, messaging, locales) 2015-04-13 08:35:03 -04:00
AlexVallat
8af9d7f361 Use a nsIWebProgressListener instead of a tabsProgressListener for location change monitoring 2015-04-13 08:34:45 -04:00
Deathamns
8c9382d4db Firefox: load content-scripts on extension start 2015-04-13 08:34:45 -04:00
Deathamns
9aaee014d4 Miscellaneous changes 2015-04-13 08:34:45 -04:00
Deathamns
9317615bc7 Firefox: improvements for content scripts 2015-04-13 08:34:45 -04:00
Deathamns
3646ecbeb2 Code styling 2015-04-13 08:34:45 -04:00
Deathamns
e9b3b5bcd2 Firefox: new method for request handling
Now both nsIContentPolicy and on-http-* observers are used for net request
monitoring.

Reasons:
 - In many cases, nsIContentPolicy.shouldLoad is invoked twice for the same
   resource, because of the speculative parsing.
 - nsIContentPolicy.shouldLoad don't have information about the channel,
   so it can't redirect the request, nor change its headers, however
   on-http-opening-request can.

Also, local mirroring and inline-script blocking has been implemented.
2015-04-13 08:34:45 -04:00
Deathamns
24bc4c9f47 Remove duplicate 'use strict'; 2015-04-13 08:34:45 -04:00
Deathamns
dced33ca44 Add license headers, plus some code styling 2015-04-13 08:34:45 -04:00
Deathamns
bc199316be Firefox: implement toolbar button and popup 2015-04-13 08:34:45 -04:00
Deathamns
41f3579461 Firefox: blocking and content scripts for e10s 2015-04-13 08:34:45 -04:00
Deathamns
05f174ab97 Firefox: add basic blocking + some fixes 2015-04-13 08:34:45 -04:00
Deathamns
ac201e2f8e Firefox: partial vAPI.tabs implementation 2015-04-13 08:34:45 -04:00
Deathamns
3b5826fe75 Firefox: implement vAPI.storage via SQLite 2015-04-13 08:34:45 -04:00
Deathamns
24163694f4 Firefox: implement content scripts 2015-04-13 08:34:45 -04:00
Deathamns
efb4b98986 Initial Firefox port (base, messaging, locales) 2015-04-13 08:34:45 -04:00
gorhill
beb70b8343 code review 2015-04-13 08:34:39 -04:00
gorhill
a26c893339 this fixes #43 2015-04-13 08:34:39 -04:00
gorhill
73dc3ba2b0 removed spurious lines of code 2015-04-13 08:34:39 -04:00
gorhill
231afb565a translation work from https://crowdin.com/project/ublock 2015-04-13 08:34:39 -04:00
AlexVallat
75ac4b979e Changes following review 2015-04-13 08:34:39 -04:00
gorhill
22bad6201e translation work from https://crowdin.com/project/ublock 2015-04-13 08:34:26 -04:00
AlexVallat
822d78be1b More restrictive monitoring.
Probably doesn't make a difference, but at least theoretically more efficient.
2015-04-13 08:34:26 -04:00
AlexVallat
c5546e322f Use a nsIWebProgressListener instead of a tabsProgressListener for location change monitoring 2015-04-13 08:34:26 -04:00
Deathamns
fd3e24713f Firefox: load content-scripts on extension start 2015-04-13 08:34:26 -04:00
Deathamns
d3223766c8 Firefox: abp:subscribe 2015-04-13 08:34:26 -04:00
gorhill
7243aedf17 this fixes #224 for Chromium 2015-04-13 08:34:26 -04:00
Deathamns
b1acfb08e6 Firefox/Fennec fixes 2015-04-13 08:34:26 -04:00
Deathamns
7b5ea26f28 Firefox/Fennec code cleanup 2015-04-13 08:34:26 -04:00
Deathamns
df2ffce8aa Firefox: match Chrome's behavior with frame ids 2015-04-13 08:34:26 -04:00
gorhill
1b66ce8b40 #795: code review as per @Deathamns feedback 2015-04-13 08:34:26 -04:00
gorhill
0f629c9df8 this fixes #795 2015-04-13 08:34:26 -04:00
Deathamns
a6dfe3f416 Firefox: remove unused arguments 2015-04-13 08:34:26 -04:00
Deathamns
1e6f29e64e Firefox: don't close popups after user interaction 2015-04-13 08:34:26 -04:00
Deathamns
052f296181 Doesn't work 2015-04-13 08:34:26 -04:00
Deathamns
eecc860be7 Firefox: use correct data for parentFrameId 2015-04-13 08:34:25 -04:00
Deathamns
65cecfe263 Firefox: each frame should have a unique ID 2015-04-13 08:34:25 -04:00
Deathamns
45cd3305d1 Firefox: remove evalInSandbox
Probably we won't eval plain text code, which makes it unnecessary, also
this way the validator on AMO won't complain about it.
2015-04-13 08:34:25 -04:00
Deathamns
cd52352995 Update frameModule.js 2015-04-13 08:34:25 -04:00
Deathamns
92838e16d3 Firefox: behind-the-scene requests / non-http tabs 2015-04-13 08:34:25 -04:00
Deathamns
ae66f96570 Firefox: minimal effort to support older versions 2015-04-13 08:34:25 -04:00
Deathamns
6250109a78 Firefox: fix tab closing issue (pop-up blocking) 2015-04-13 08:34:25 -04:00
gorhill
f482164601 removed unused code for the time being 2015-04-13 08:34:25 -04:00
Deathamns
c46d25874d URL handling changes 2015-04-13 08:34:25 -04:00
Deathamns
46883756e5 Miscellaneous changes 2015-04-13 08:34:25 -04:00
Deathamns
f51bb42fa4 Firefox: fixed content scripts? 2015-04-13 08:34:25 -04:00
Deathamns
de1f643510 Firefox: improvements for content scripts 2015-04-13 08:34:25 -04:00
Deathamns
f570bc7f48 Firefox: simplify vAPI.app.restart 2015-04-13 08:34:25 -04:00
Deathamns
6571a0700f Firefox: workaround for the e10s crash 2015-04-13 08:34:25 -04:00
Deathamns
9f4e9d48da Firefox: blocking improvements / other fixes
- Implement pop-up blocking
- Support blocking redirected requests
- Fix Local mirroring and inline-script blocking
- Block content on data: and about:blank pages
2015-04-13 08:34:25 -04:00
Deathamns
40b191e9f4 Code styling 2015-04-13 08:34:25 -04:00
Deathamns
de2f0bb292 Firefox: ownsWeak=true for observers, +minor mods 2015-04-13 08:34:25 -04:00
Deathamns
1b71f8bba3 Firefox: new method for request handling
Now both nsIContentPolicy and on-http-* observers are used for net request
monitoring.

Reasons:
 - In many cases, nsIContentPolicy.shouldLoad is invoked twice for the same
   resource, because of the speculative parsing.
 - nsIContentPolicy.shouldLoad don't have information about the channel,
   so it can't redirect the request, nor change its headers, however
   on-http-opening-request can.

Also, local mirroring and inline-script blocking has been implemented.
2015-04-13 08:34:25 -04:00
Deathamns
08f87c72bb Fix build scipts' shebang, let -> const 2015-04-13 08:34:25 -04:00
Deathamns
54d264646a Firefox: better way to get the messageManager 2015-04-13 08:34:25 -04:00
Deathamns
6faa9e85c2 Add license headers, plus some code styling 2015-04-13 08:34:25 -04:00
Deathamns
afe6a29c36 Firefox: minor changes 2015-04-13 08:34:25 -04:00
Deathamns
0579c1bcaa Firefox: fix script injection 2015-04-13 08:34:25 -04:00
Deathamns
d66b8aa329 Firefox: implement vAPI.tabs.injectScript 2015-04-13 08:34:25 -04:00
Deathamns
12ca303901 Firefox: fix 'main_frame' for e10s 2015-04-13 08:34:25 -04:00
Deathamns
0fd304947c Firefox: initialize buttons when DOM is ready 2015-04-13 08:34:25 -04:00
Deathamns
500213f479 Firefox: observe main_frame requests too 2015-04-13 08:34:25 -04:00
Deathamns
33c052e397 Firefox: fix styling for toolbar button 2015-04-13 08:34:25 -04:00
Deathamns
4f7070cf5d Firefox: implement toolbar button and popup 2015-04-13 08:34:25 -04:00
Deathamns
7f422ae479 Firefox: blocking and content scripts for e10s 2015-04-13 08:34:25 -04:00
gorhill
38a1cce634 this fixes https://github.com/chrisaljoudi/uBlock/issues/1219 for Firefox 2015-04-13 08:34:15 -04:00
Deathamns
5ab3550697 Firefox: minor changes 2015-04-13 08:34:15 -04:00
Deathamns
7310e1eaa0 Firefox: update manifest files when building 2015-04-13 08:34:15 -04:00
Deathamns
c5517fa6b4 Firefox: add basic blocking + some fixes 2015-04-13 08:34:15 -04:00
Deathamns
c1cfdc61da Initial Firefox port (base, messaging, locales) 2015-04-13 08:34:15 -04:00
gorhill
13eb2edb59 as per comment in e762a29d30 2015-04-13 08:34:04 -04:00
gorhill
031f6a90ee #10: manually imported fixes from e762a29d30 2015-04-13 08:34:04 -04:00
gorhill
1ab6e08f71 this fixes https://github.com/chrisaljoudi/uBlock/issues/1219 for Firefox 2015-04-13 08:34:04 -04:00
Deathamns
0369bf4b6a Firefox: fix extension restarting 2015-04-13 08:34:04 -04:00
Deathamns
5cac2aea84 Firefox: get the version number from the fragment 2015-04-13 08:34:04 -04:00
Deathamns
73945064ed Firefox: initialize when hiddenDOMWindow is ready
Probably not the best way to detect its readiness, but it works for now.
This fix should solve the incompatibility with the StartupMaster add-on.
2015-04-13 08:34:04 -04:00
Deathamns
56bac7a565 URL handling changes 2015-04-13 08:34:04 -04:00
Deathamns
6123cc8e15 Firefox: simplify vAPI.app.restart 2015-04-13 08:34:04 -04:00
Deathamns
6c06436452 Firefox: popup size for menu-panel 2015-04-13 08:34:04 -04:00
Deathamns
4090805223 Firefox: implement vAPI.app.restart 2015-04-13 08:34:04 -04:00
Deathamns
ff7c9e96ae Code styling 2015-04-13 08:34:04 -04:00
Deathamns
37a9f4d762 Firefox: revert previous change
Initializing the extension with AddonManager takes too long (at least for
this extension).
When starting the browser, tabs loaded before the extension could, and
because of that, blocking didn't work.
It works better, if it's initialized when the window's DOM is ready.
2015-04-13 08:34:04 -04:00
Deathamns
81c710c360 Firefox,Safari: fill vAPI.app in a different way
Pass the extension data (name and version) as the fragment of the URL
for the background script, so vAPI.app can be filled without using XHR
to read the manifest files.
2015-04-13 08:34:04 -04:00
Deathamns
a9b91ee0b6 Add license headers, plus some code styling 2015-04-13 08:34:04 -04:00
Deathamns
29d2cdc015 Firefox: initialize buttons when DOM is ready 2015-04-13 08:34:04 -04:00
Deathamns
8e5850423c Firefox: implement toolbar button and popup 2015-04-13 08:34:04 -04:00
Deathamns
94a47e7d4d Firefox: partial vAPI.tabs implementation 2015-04-13 08:34:04 -04:00
Deathamns
ae36081605 Initial Firefox port (base, messaging, locales) 2015-04-13 08:34:04 -04:00