Phil 7.23.15

9:00 – 5:00 SR

  • First, I’m going to check to see if I can pull in and display an entire webpage with ng-sanitize
  • Had to get a cert for my dev machine php install to get curl to be able to pull https content. Here’s the relevant info from the php.net post
Please everyone, stop setting CURLOPT_SSL_VERIFYPEER to false or 0. If your PHP installation doesn't have an up-to-date CA root certificate bundle, download the one at the curl website and save it on your server:

http://curl.haxx.se/docs/caextract.html

Then set a path to it in your php.ini file, e.g. on Windows:

curl.cainfo=c:\php\cacert.pem

Turning off CURLOPT_SSL_VERIFYPEER allows man in the middle (MITM) attacks, which you don't want!
  • Adding the ability to open full pages. It’s now working (not for all pages, will need to finesse that), but I had a few moments where Chrome would NOT LET GO of its cache. Sheesh.
  • Loading the html in the PHP and sending it back as content didn’t work. The trick is to open the page in a frame directly (and save the link) Based on the stackoverflow staring point.
      • Use the $sce service component from ngSanitize and inject in the main module:
        this.appModule.directive('ngFeedPanel', ['$timeout','$rootScope', '$sce', queryDirectivePtr]);
      • It gets incorporated in the directive so:
        public ctor(timeout:ng.ITimeoutService, rootscope:ng.IScope, sce:ng.ISCEService):ng.IDirective {
            this.sceProvider = sce;
            // other stuff goes here
        }
      • That in turn gets called in the html like this:
        
        
  • Lastly, getLink() in the directive looks like:
    scope.getLink = ():void => {
        var mobj:RssControllersModule.IDataResponse = scope.messageObj;
        return this.sceProvider.trustAsResourceUrl(mobj.link);
    };
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: