Giter Site home page Giter Site logo

appcelerator-forks / jigarm.tiwebview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jigarm/tiwebview

0.0 2.0 1.0 301 KB

This is a simple extension to Appcelerator Titanium that allows you to set cookies and delete cookiew for TiWebViews on iOS.

License: Apache License 2.0

Objective-C 26.64% Python 66.51% JavaScript 6.85%

jigarm.tiwebview's Introduction

TiWebView

This is a simple extension to Appcelerator Titanium that allows you to set cookies and delete cookiew for TiWebViews on iOS.

Installation

  1. Add the following to the <modules> tag in your tiapp.xml.
<modules>
    <module version="0.1">com.mobmaxime.TiWebview</module>
</modules>
  1. Copy the file titled com.mobmaxime.TiWebview-iphone-0.1.zip into your Titanium project Directory. Titanium will automatically unzip this and place the appropriate files in the modules/ directory.

Usage

Make sure to require the module like so:

var TiWebview = require('com.mobmaxime.TiWebview');

List out the Cookie OR Get All Cookie for Webview :

var Cookies = TiWebview.listCookies('http://github.com/JigarM');
for (var key in Cookies) {
    Ti.API.info('Name ==> ' + key + ' and Value ==>: ' + Cookies[key]);
}

The whole thing for getting All cookies of UIWebview:

var webview = Ti.UI.createWebView({
    url : 'http://github.com/JigarM'
});

webview.addEventListener('load', function(e) {
    var url = e.url;
    Ti.API.info('Cookies of URL ==>  ' + url);
    
    var Cookies = TiWebview.listCookies(url);
    var count = 0;
    for (var key in Cookies) {
        Ti.API.info('Name ==> ' + key + ' and Value ==>: ' + Cookies[key]);
        count++;
    }

    if (Cookies.logged_in) {
        Ti.API.info('is logged_in? ==> ' + Cookies.logged_in);
    }
});

You can Delete the UIWebview Cookies using following Method :

TiWebview.deleteAllCoockie("github.com");

TODO

  • Create validation to check values passed for cookie / user agent
  • Need to Make theAndroid version

jigarm.tiwebview's People

Contributors

jigarm avatar jigarmobmaxime avatar

Watchers

James Cloos avatar Brenton House avatar

Forkers

astrovic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.