Saturday, November 28, 2015

View unlimited articles on Harvard Business Review and Economist.com


In this post I am going to discuss with you a chrome extension I developed to view unlimited articles on Harvard business Review and Economist.com

Harvard Business Review allow unregistered users to view 5 articles at max where as Economist allows unregistered user to view at max 3 articles for the 4th article click it asks users to pay for registration before viewing new articles.

One manual hack is to install a chrome extension like Cookie inspector or Cookie manager and delete the cookie before proceeding to view other (blocked) articles.

to avoid this manual work. I created a chrome extension which does this automatically.

So the idea is the same for both Harvard Business Review(HBR) and Economist. That is every time a user clicks on any hyper link delete the associated cookie of the respective domains.
The code can be found at github repo

Technical layout :
Architecture of chrome extension allows user to create scripts of various types. For ex: Content scripts or background scripts. Content scripts can access the DOM structure of the HTML page on which it has the permission to inject where as background scripts can access Chrome* api and can run some background job either in persistent mode or trigger based mode.

WORKING : 
For this chrome extension, I have created a content.js which gets injected in the DOM structure of Economist/HBR as defined by the permissions given in the manifest file. So every time a user clicks on any anchor tag ('<a href="....">'). A message is sent to background script (BackGround.js). So in this case background script is triggered via a message sent by content script and hence is non persistent as configured by manifest file.

When the background script receives a trigger from content script it invokes chrome api for cookies. So first it gets all the cookies associated with the concerned domain - in this case HBR and Economist. After all the cookie associated with the HBR or Economist domain is received, they are iterated one at a time and removed using chrome api.

AFTER EFFECTS :
After you add chrome extension on your chrome. Go to hbr.org.
Now select any articles to read, you will land on specific article page. The number of articles left for free view can be seen at bottom of page.


Now go back to hbr.org by clicking on anchor tag on the left side of the page


Same goes for economist.com

How to install Chrome Extension on chrome :
1.) Go to chrome://extensions/
2.) Next check the developer mode
3.) click on load unpacked extension


4.) Find the location of the chrome extension 

Now you are good to go. Just in case if you have already opened HBR or Economist make sure to reload the page.


5 comments:

  1. Does this still work as of September 2019?

    ReplyDelete
  2. This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. Brasa Capital Management

    ReplyDelete
  3. Noticed the code was removed on GITHUB... is there any alternate links?

    ReplyDelete
  4. start a new business Finding the right online business opportunity is an exciting for many of us. There's dreams of making an extra $10,000 which is usually the magic number for most people that would allow them to quit their day jobs, get rid of that lousy commute to and from work, and live the dream of having more free time to live life on our terms.

    ReplyDelete