Giter Club home page Giter Club logo

ios-injectjs's Introduction

ios-injectjs

##说在前面 本项目实现的是向ios的webview中注入js。基于ios8以上的wkwebview,使用swift语言实现

##初始化 请在本地起一个服务用来提供注入的js文件(用服务的形式实现注入是为了方便加载更新后的js文件,比如和gulp打包一起用),项目中默认的js文件服务地址为 http://localhost:8888/example.js 一共有两处,一处用于初始化,一处用于更新加载。期待未来有好心人把这一处改成系统变量。 默认加载的网页是http://m.jd.com,请修改成自己想要注入js的网页的地址

##如果想要使用js动态更新,而不是重新打包ios项目的话 请在js执行中加入webkit.messageHandlers.callbackHandler.postMessage('reloadjs');然后用Safari调试工具刷新两次即可

##听说safari的Webview调试工具与这个项目一起使用更配哦

##视频教程 http://v.youku.com/v_show/id_XMTM3MzIzOTMwNA==.html?firsttime=0 密码请联系作者,微信lqchao007

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.