Commit Graph

422 Commits (6123cc8e15ee1d3d7a10bffa7d687626e6af62b6)
 

Author SHA1 Message Date
Deathamns 6123cc8e15 Firefox: simplify vAPI.app.restart 9 years ago
Deathamns 6c06436452 Firefox: popup size for menu-panel 9 years ago
Deathamns 4090805223 Firefox: implement vAPI.app.restart 9 years ago
Deathamns ff7c9e96ae Code styling 9 years ago
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.
9 years ago
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.
9 years ago
Deathamns a9b91ee0b6 Add license headers, plus some code styling 9 years ago
Deathamns 29d2cdc015 Firefox: initialize buttons when DOM is ready 9 years ago
Deathamns 8e5850423c Firefox: implement toolbar button and popup 9 years ago
Deathamns 94a47e7d4d Firefox: partial vAPI.tabs implementation 9 years ago
Deathamns ae36081605 Initial Firefox port (base, messaging, locales) 9 years ago
gorhill 19ddf588fb i18n work 9 years ago
gorhill ed67045360 first pass 9 years ago
gorhill a5d051de3f this fixes #792 9 years ago
Deathamns 7ef116e85b Remove unnecessary fallback code for downloading 9 years ago
Chris 33ffb83f23 Fix vAPI.download across all platforms 9 years ago
gorhill daede90cc7 this helps #993 9 years ago
gorhill 72a3819c08 #685: code review 9 years ago
Deathamns 32ad9420de Chrome: bypass options_ui 9 years ago
Deathamns 86cae37cb6 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.
9 years ago
Deathamns d789ffa442 Popup related changes 9 years ago
Deathamns 1807c74580 Add license headers, plus some code styling 9 years ago
Raymond Hill 4c12408b1e jshint 9 years ago
Raymond Hill 09123d6971 use "platform" as suggested in #360 9 years ago
Raymond Hill d6d7f9347a use "platform" as suggested in #360 9 years ago
Raymond Hill 5bc14936d5 jshint 9 years ago
Raymond Hill e260b19702 restore original semantic 9 years ago
Raymond Hill 5cd1285ee5 further separate platform-specific code 9 years ago
Deathamns e54c09da8a Ports cleanup
- Remove duplicate platform specific (from src/) and other unnecessary
  files
- Fix and update vapi-*.js files for Safari
- Add tools/make-safari.sh
- Move js/vapi-appinfo.js to meta/ (so, every vendor specific file will be
  at the same location)
9 years ago
Deathamns e6e3868080 Building extension files
Adds possibility to build extension files (Chrome and Safari) from
command line.

To run from the project directory:
python tools/build.py [meta]

If the optional `meta` argument is set, then only the manifest and
language files are uptated.
Without that everything is being built (extension files too) into the
`dist/build/version_number` folder.

For Chrome there will be two files, a crx, and a .zip file which
includes the key.pem private key (so this must not be shared,
it's just a bit help for publishing it to the Chrome Web Store).

Beside the extension files, update-files are generated too (for self
hosting - Safari needs it).
9 years ago
Deathamns 9f23b45651 Site-patching possibility for Safari
Safari's extension API doesn't provide a way to intercept requests
initiated by plugins, so those cases need special care (or at least the
popular sites).

This commit adds a new JS file (sitepatch-safari.js), which will store the
patches (if it's possible to create one) for specific sites.

As an example, this commit includes a technique for removing in-video ads
from YouTube videos.
9 years ago
Deathamns 686403af38 Avoid using Chrome's @@bidi_* type i18n messages
... for the sake of portability.

When including vapi-common.js in an HTML file, then the body element there
will have a "dir" attribute filled with the current locale's direction
(ltr or rtl).

The following languages are considered right-to-left: ar, he, fa, ps, ur.
Everything else is left-to-right.

After the "dir" attribute is set, we can decide in CSS which elements
should have different styling for rtl languages (e.g., body[dir=rtl] #id).
9 years ago
Deathamns 358ec2c644 Fix download URL for the fallback method 9 years ago
Deathamns da0e62dff6 Use HTML5 download instead of extension API
Benefits:
- Cross browser solution (however only for relatively new browsers)
- Doesn't need extra permission in Chrome

If the browser doesn't suppor the download attribute, then a new tab will
be opened with the exported data.

Other changes:
- Start the download only if the data is not empty (previously the
  download started anyway)
- Reorder code in vapi-client.js for Safari, so unnecessary code doesn't
  run on extension pages
9 years ago
Deathamns 25caa9241c Set default dimensions for Safari's popup 9 years ago
Deathamns 2216b7f32e Implement popup autoresizing for Safari
By default, Safari doesn't resize the popup to its content, but it's
possible to set the size pragmatically.
The popup will be resized every time when a change happens in the DOM tree.
9 years ago
Deathamns db83931fb7 Add .jshintrc, and use the "use strict" directive
.jshintrc's otion-set is a personal choice, merely a suggestion.
Beside that, it includes some common globals for specific browsers, so
there's no need to set the globals in every .js file.

In order to force strict coding, "use strict" directive was added into
every .js file.
9 years ago
Deathamns cd08ad9782 Work on vendor API abstraction, and near complete Safari support 9 years ago
gorhill 9bb22b65ec forgot to add shutdown to other platforms (re. https://github.com/gorhill/uMatrix/issues/144) 9 years ago
gorhill dd60a74e3f code review 9 years ago
gorhill 987acfef65 this fixes https://github.com/gorhill/uMatrix/issues/144 9 years ago
YFdyh000 5ff7909497 Correct issue links 9 years ago
gorhill 170f164288 had a doubt, had to check it worked as intended 9 years ago
Deathamns 4599486290 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).
9 years ago
Chris db772dea22 Remove previous Safari overhead; cleanup workarounds from rest of code 9 years ago
gorhill 894921e23f not needed 9 years ago
Deathamns bd0b1638db URL handling changes 9 years ago
gorhill 9172fcd049 this fixes one part of #498 9 years ago
Deathamns 3d40e0b2aa Code styling 9 years ago
Deathamns 5ec2e067df Add license headers, plus some code styling 9 years ago