├── firefox ├── README.md ├── icon.png ├── icon64.png ├── package.json ├── index.js └── data │ └── nepijano.js ├── chrome ├── icon_128.png ├── icon_16.png ├── icon_48.png ├── manifest.json ├── background.js └── nepijano.js ├── releases ├── nepi-jano_0.10.0.xpi ├── nepi-jano_0.11.0.xpi ├── nepi-jano_0.9.6.xpi ├── nepi-jano_0.9.7.xpi ├── nepi_jano_0.1.1.crx ├── nepi_jano_0.1.2.crx ├── nepi_jano_0.10.0.crx ├── nepi_jano_0.10.0.zip ├── nepi_jano_0.9.0.crx ├── nepi_jano_0.9.1.crx ├── nepi_jano_0.9.2.crx ├── nepi_jano_0.9.3.crx ├── nepi_jano_0.9.4.crx ├── nepi_jano_0.9.5.crx ├── nepi_jano_0.9.6.crx ├── nepi_jano_0.9.7.crx ├── nepi_jano_0.9.7.zip ├── nepi_jano_0.10.0.crx.zip ├── nepi_jano_0.9.7.crx.zip ├── nepi-jano_0.9.7.safariextz └── nepi_jano_0.10.0.safariextz ├── safari └── nepi_jano.safariextension │ ├── Icon.png │ ├── Icon_64.png │ ├── global.html │ ├── Info.plist │ └── nepijano.js ├── MIT-LICENSE.txt ├── readme.md └── GPL-LICENSE.txt /firefox/README.md: -------------------------------------------------------------------------------- 1 | # Nepi Jano! 2 | Read paid content on www.sme.sk -------------------------------------------------------------------------------- /firefox/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/firefox/icon.png -------------------------------------------------------------------------------- /chrome/icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/chrome/icon_128.png -------------------------------------------------------------------------------- /chrome/icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/chrome/icon_16.png -------------------------------------------------------------------------------- /chrome/icon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/chrome/icon_48.png -------------------------------------------------------------------------------- /firefox/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/firefox/icon64.png -------------------------------------------------------------------------------- /releases/nepi-jano_0.10.0.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi-jano_0.10.0.xpi -------------------------------------------------------------------------------- /releases/nepi-jano_0.11.0.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi-jano_0.11.0.xpi -------------------------------------------------------------------------------- /releases/nepi-jano_0.9.6.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi-jano_0.9.6.xpi -------------------------------------------------------------------------------- /releases/nepi-jano_0.9.7.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi-jano_0.9.7.xpi -------------------------------------------------------------------------------- /releases/nepi_jano_0.1.1.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.1.1.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.1.2.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.1.2.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.10.0.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.10.0.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.10.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.10.0.zip -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.0.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.0.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.1.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.1.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.2.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.2.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.3.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.3.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.4.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.4.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.5.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.5.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.6.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.6.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.7.crx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.7.crx -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.7.zip -------------------------------------------------------------------------------- /releases/nepi_jano_0.10.0.crx.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.10.0.crx.zip -------------------------------------------------------------------------------- /releases/nepi_jano_0.9.7.crx.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.9.7.crx.zip -------------------------------------------------------------------------------- /releases/nepi-jano_0.9.7.safariextz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi-jano_0.9.7.safariextz -------------------------------------------------------------------------------- /releases/nepi_jano_0.10.0.safariextz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/releases/nepi_jano_0.10.0.safariextz -------------------------------------------------------------------------------- /safari/nepi_jano.safariextension/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/safari/nepi_jano.safariextension/Icon.png -------------------------------------------------------------------------------- /safari/nepi_jano.safariextension/Icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ejci/nepi-jano/HEAD/safari/nepi_jano.safariextension/Icon_64.png -------------------------------------------------------------------------------- /firefox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Nepi Jano!", 3 | "name": "nepi-jano", 4 | "version": "0.11.0", 5 | "description": "Read paid content on www.sme.sk", 6 | "main": "index.js", 7 | "author": "Miroslav Magda, Viliam Pucik", 8 | "homepage": "https://github.com/ejci/nepi-jano", 9 | "engines": { 10 | "firefox": ">=38.0a1", 11 | "fennec": ">=38.0a1" 12 | }, 13 | "license": "MPL-2.0", 14 | "keywords": [ 15 | "jetpack" 16 | ], 17 | "permissions": { 18 | "cross-domain-content": ["http://s.sme.sk/"] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chrome/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Nepi Jano!", 3 | "description": "This extension allows to read paid content on www.sme.sk.", 4 | "version": "0.10.0", 5 | "manifest_version": 2, 6 | "permissions": ["webRequest", "webRequestBlocking", "*://*.sme.sk/*"], 7 | "background": { 8 | "scripts": ["background.js"] 9 | }, 10 | "content_scripts": [ 11 | { 12 | "js": ["nepijano.js"], 13 | "matches": ["*://*.sme.sk/*"] 14 | } 15 | ], 16 | "homepage_url": "https://github.com/ejci/nepi-jano", 17 | "icons": { 18 | "16": "icon_16.png", 19 | "48": "icon_48.png", 20 | "128": "icon_128.png" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /firefox/index.js: -------------------------------------------------------------------------------- 1 | var data = require("sdk/self").data; 2 | var pageMod = require("sdk/page-mod").PageMod; 3 | var request = require("sdk/request").Request; 4 | 5 | pageMod({ 6 | include : /.*\.sme\.sk\/c\/\d+\/.*/, 7 | contentScriptFile : data.url("nepijano.js"), 8 | onAttach : function(worker) { 9 | worker.port.on("loadPage", function(url) { 10 | request({ 11 | url : url, 12 | headers : { 13 | "User-Agent" : "", 14 | }, 15 | onComplete : function(response) { 16 | if (response.status == 200) { 17 | worker.port.emit("rewritePage", response.text); 18 | } 19 | } 20 | }).get(); 21 | }); 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /chrome/background.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Nepi Jano Google Chrome extension 3 | * @author Miroslav Magda, http://blog.ejci.net 4 | * @version 0.10.0 5 | */ 6 | 7 | /** 8 | * For each request to sme.sk remove UA string 9 | */ 10 | chrome.webRequest.onBeforeSendHeaders.addListener(function(details) { 11 | for (var i = 0; i < details.requestHeaders.length; ++i) { 12 | //remove UA string :) 13 | if (details.requestHeaders[i].name.toLowerCase() == 'user-agent') { 14 | details.requestHeaders.splice(i, 1); 15 | break; 16 | } 17 | } 18 | return { 19 | requestHeaders : details.requestHeaders 20 | }; 21 | }, { 22 | urls : ["*://*.sme.sk/*"] 23 | }, ["blocking", "requestHeaders"]); 24 | -------------------------------------------------------------------------------- /safari/nepi_jano.safariextension/global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Miroslav Magda, http://ejci.net/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /safari/nepi_jano.safariextension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Author 6 | Miroslav Magda, Jakub Zitny 7 | Builder Version 8 | 9537.85.10.17.1 9 | CFBundleDisplayName 10 | Nepi Jano! 11 | CFBundleIdentifier 12 | com.ejci.nepijano 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleShortVersionString 16 | 0.10.0 17 | CFBundleVersion 18 | 1 19 | Chrome 20 | 21 | Global Page 22 | global.html 23 | 24 | Content 25 | 26 | Scripts 27 | 28 | End 29 | 30 | nepijano.js 31 | 32 | 33 | 34 | Description 35 | This extension allows access to paid content on sme.sk. 36 | DeveloperIdentifier 37 | 9XH4QDTV5W 38 | ExtensionInfoDictionaryVersion 39 | 1.0 40 | Permissions 41 | 42 | Website Access 43 | 44 | Allowed Domains 45 | 46 | *.sme.sk 47 | 48 | Level 49 | Some 50 | 51 | 52 | Website 53 | https://github.com/ejci/nepi-jano/ 54 | 55 | 56 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | Nepi Jano! extension 0.10.0 2 | ======= 3 | 4 | Nepi Jano! is a extension for Google Chrome, Firefox & Safari that allows to read paid articles on [www.sme.sk](http://www.sme.sk). 5 | 6 | ======= 7 | ### Im not supporting this extension anymore. Feel free to fork it and make changes. 8 | 9 | There is a fork that is maintained by @viliampucik https://github.com/viliampucik/nepi-jano. Drop there for new versions. 10 | 11 | ======= 12 | 13 | ## Instalation / Update Google Chrome (0.10.0) 14 | * [Download extension](https://github.com/ejci/nepi-jano/raw/master/releases/nepi_jano_0.10.0.crx.zip) (.zip) 15 | * Unzip downloaded file (.crx) 16 | * Type chrome://extensions in your Google Chrome browser 17 | * Drag and drop unziped (.crx) file to Google Chrome extensions tab 18 | 19 | ### Alternative guide for Chrome 35+ on Windows 20 | * [Download extension](https://github.com/ejci/nepi-jano/raw/master/releases/nepi_jano_0.10.0.zip) (.zip) 21 | * Unzip downloaded file (.zip) 22 | * Type chrome://extensions in your Google Chrome browser 23 | * Enable "*Developer mode*" 24 | * "*Load unpacked extension...*" from folder where you unpacked the extension 25 | 26 | ## Instalation / Update Safari (0.10.0) 27 | * [Download extension](https://github.com/ejci/nepi-jano/raw/master/releases/nepi_jano_0.10.0.safariextz) (.safariextz) 28 | * Doubleclick the downloaded .safariextz file 29 | * Pres *Install* 30 | 31 | ## Installation / Update Firefox (0.10.0) 32 | * [Download addon](https://github.com/ejci/nepi-jano/raw/master/releases/nepi-jano_0.10.0.xpi) 33 | * New Tab -> Open File ... (Ctrl+O) 34 | * Select the downloaded addon (.xpi) 35 | * Press *Install Now* 36 | 37 | 38 | ## How to use it 39 | Just install extension and click on some paid link on [www.sme.sk](http://www.sme.sk) and wait for it... 40 | 41 | ## How it works 42 | Read my blog posts about it: [2013.04.21](http://blog.ejci.net/2013/04/21/piano-and-sme-sk/), [2013.05.19](http://blog.ejci.net/2013/05/19/paid-content-for-free-on-slovak-news-portals/) 43 | 44 | --- 45 | ## Disclaimer 46 | This extension was made only for test purposes. 47 | Buy [Piano](http://www.pianomedia.sk) subscription. You wil save hungry children in Africa! Seriously. Don't be an asshole and buy subscription. 48 | 49 | --- 50 | ##### Version 51 | * 0.10.0 52 | 53 | ##### Author 54 | * [Miroslav Magda](http://ejci.net) 55 | 56 | ##### Contrubitors 57 | * [Viliam Pucik](https://github.com/viliampucik) - Extension for Firefox 58 | * [Jakub Zitny](https://github.com/jakubzitny) - Extension for Safari 59 | * [Daniel Husar](https://github.com/danielhusar) - Various fixes 60 | 61 | --- 62 | 63 | ## License 64 | All code is open source and dual licensed under GPL and MIT. Check the individual licenses for more information. 65 | 66 | 67 | ### Change log 68 | 69 | #### 0.10.0 70 | * Update for sme.sk update of mobile app 71 | 72 | #### 0.9.7 73 | * Update for sme.sk redesign 74 | 75 | #### 0.9.6 76 | * Code cleanup 77 | 78 | #### 0.9.5 79 | * another fix for hnonline.sk 80 | 81 | #### 0.9.4 82 | * fix for hnonline.sk 83 | - after my report to hnonline.sk they fixed it so i made a simple workaround 84 | * etrend.sk support (piano paid content, content for subscribers) 85 | 86 | #### 0.9.3 87 | * partial support for hnonline.sk 88 | 89 | #### 0.9.2 90 | * jQuery 2.0.0 91 | * Bugfix (change link s.sme.sk/export/phone/?c=XXX to www.sme.sk/c/XXX/) 92 | 93 | #### 0.9.1 94 | * Bugfixes 95 | * Rewriting extension 96 | * View paid videos with custom HTML5 video player 97 | 98 | #### 0.9.0 99 | * View paid articles 100 | 101 | #### 0.1.2 102 | * Proof of concept working on Windows 103 | 104 | #### 0.1.1 105 | * Proof of concept (stand alone extension) 106 | -------------------------------------------------------------------------------- /firefox/data/nepijano.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Nepi Jano Firefox extension 3 | * @author Miroslav Magda, http://blog.ejci.net 4 | * @author Viliam Pucik, http://viliampucik.blogspot.com/ 5 | * @version 0.11.0 6 | */ 7 | 8 | /** 9 | * some utils 10 | */ 11 | var utils = {}; 12 | 13 | /** 14 | * Get parameter from url (if exists) 15 | */ 16 | utils.urlParam = function(name, url) { 17 | url = (url) ? url : window.location.href; 18 | name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 19 | var regexS = "[\\?&]" + name + "=([^&#]*)"; 20 | var regex = new RegExp(regexS); 21 | var results = regex.exec(url); 22 | if (results === null) { 23 | return false; 24 | } else { 25 | return results[1]; 26 | } 27 | return false; 28 | }; 29 | 30 | /** 31 | * Remove elements with selector from document 32 | */ 33 | utils.removeSelector = function(doc, selector) { 34 | var elements = doc.querySelectorAll(selector); 35 | var i = elements.length; 36 | while (i--) { 37 | elements[i].parentNode.removeChild(elements[i]); 38 | } 39 | return doc; 40 | }; 41 | 42 | /** 43 | * Fix urls in anchors 44 | */ 45 | utils.fixAnchors = function(doc) { 46 | var elements = doc.querySelectorAll('a'); 47 | var i = elements.length; 48 | while (i--) { 49 | var url = elements[i].getAttribute('href'); 50 | var articleId = utils.urlParam('c', url); 51 | var galleryId = utils.urlParam('g', url); 52 | if (/s.sme.sk\//i.test(url) && articleId) { 53 | elements[i].setAttribute('href', document.location.protocol + '//' + document.location.hostname + '/c/' + articleId + '/'); 54 | } 55 | if (/s.sme.sk\//i.test(url) && galleryId) { 56 | elements[i].setAttribute('href', document.location.protocol + '//' + document.location.hostname + '/galeria/' + galleryId + '/' + Math.random().toString(36).substr(2, length) + '/'); 57 | } 58 | 59 | } 60 | return doc; 61 | }; 62 | /** 63 | * Fix video tags 64 | */ 65 | utils.fixVideos = function(doc) { 66 | var elements = doc.querySelectorAll('.iosvideo'); 67 | var i = elements.length; 68 | while (i--) { 69 | var videoUrl = elements[i].querySelector('a[href$=mp4]').getAttribute('href'); 70 | var videoPosterUrl = elements[i].querySelector('.videoimg').getAttribute('src'); 71 | elements[i].innerHTML = '