Code Monkey home page Code Monkey logo

macgap1's Introduction

MacGap

The MacGap project provides HTML/JS/CSS developers an Xcode project for developing Native OSX Apps that run in OSX's WebView and take advantage of WebKit technologies.

The project exposes a JavaScript API for OS X integration, such as displaying native OS X 10.9 notifications. The MacGap project is extremely lightweight and nimble; a blank application is about 980KB.

Features:

  • tiny compiled app sizes
  • Mac App Store compatible
  • access to many Mac OS X-specific features

Pre-requisites

MacGap works on OSX 10.6 and later.

Generate apps with the macgap generator, no compile necessary.

gem install macgap

macgap new myapp
macgap build myapp

API

MacGap exposes an object called macgap inside JavaScript. You can use it to alter the Dock icon and display Growl notifications, amongst other things. The API is documented in the WIKI on GitHub: https://github.com/maccman/macgap/wiki

Attributes

MacGap was forked/ported from Phonegap-mac. It's under the same license (MIT).

Custom Build

To build, make sure you have installed the latest Mac OSX Core Library. Download at http://developer.apple.com/.

Just clone the repository and build in Xcode. The file public/index.html is loaded on startup.

macgap1's People

Contributors

alex-stripe avatar amilajack avatar colinc86 avatar hemancuso avatar jeff-h avatar jlarky avatar liamks avatar maccman avatar macmee avatar rawcreative avatar torjue avatar zarel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macgap1's Issues

MacGap breaks mac os x?

Opening a macgap app in 10.8.2 results in the dock reopening, the desktop getting an old background and heat issues because of high load. All I could find in the console was this;


10/2/12 1:44:36.064 PM Dock[152]: -[__NSCFNumber length]: unrecognized selector sent to instance 0x7f911e079010
10/2/12 1:44:36.068 PM Dock[152]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0x7f911e079010'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8b95c0a6 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff939973f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8b9f26ea -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
    3   CoreFoundation                      0x00007fff8b94a5ce ___forwarding___ + 414
    4   CoreFoundation                      0x00007fff8b94a3b8 _CF_forwarding_prep_0 + 232
    5   Dock                                0x0000000109c7e184 Dock + 549252
    6   Dock                                0x0000000109c7e117 Dock + 549143
    7   Dock                                0x0000000109ca4f2c Dock + 708396
    8   Dock                                0x0000000109c7e095 Dock + 549013
    9   Dock                                0x0000000109c7e052 Dock + 548946
    10  HIServices                          0x00007fff928a4f4e mshMIGPerform + 443
    11  CoreFoundation                      0x00007fff8b8cb2d9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    12  CoreFoundation                      0x00007fff8b8cb019 __CFRunLoopDoSource1 + 153
    13  CoreFoundation                      0x00007fff8b8fe19f __CFRunLoopRun + 1775
    14  CoreFoundation                      0x00007fff8b8fd6b2 CFRunLoopRunSpecific + 290
    15  Dock                                0x0000000109cc61fe Dock + 844286
    16  libdyld.dylib                       0x00007fff919877e1 start + 0
)
10/2/12 1:44:37.039 PM coreservicesd[33]: SendFlattenedData, got error #268435459 (ipc/send) invalid destination port from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=127
10/2/12 1:44:37.042 PM NotificationCenter[163]: Connection interrupted.
10/2/12 1:44:37.045 PM com.apple.launchd.peruser.501[140]: (com.apple.Dock.agent[152]) Job appears to have crashed: Abort trap: 6
10/2/12 1:44:37.288 PM ReportCrash[304]: Saved crash report for Dock[152] version 1.8 (1168.6) to /Users/csillevis/Library/Logs/DiagnosticReports/Dock_2012-10-02-134437_Chases-MacBook-Pro.crash
10/2/12 1:44:37.322 PM ReportCrash[304]: Removing excessive log: file://localhost/Users/csillevis/Library/Logs/DiagnosticReports/Dock_2012-09-27-064205_Chases-MacBook-Pro.crash

Clipboard access

Support for reading from and writing to the clipboard would be awesome.

Support for custom Growl notification icons

It would be awesome to have custom icons in Growl notifications. The Growl notification API supports setting an icon (via iconData parameter) for notification. It would dramatically improve our message notifications if we could display the user's avatar or other relevant icon by simply providing the URL.

For example:

// Send a Growl notification
macgap.growl.notify({
  title: "Notify",
  content: "New Message!",
  icon: "/path/to/icon"
});

Better phrasing for supported OSX Versions

Hey,

when i read "MacGap works on OSX 10.6 and 10.5." i thought it ONLY runs on 10.6 and 10.5.

Maybe something like "MacGap works on OSX 10.5+" or "MacGap works on OSX 10.5 or higher". ?

How is the window title set?

I'm using macgap to wrap a jQuery mobile app.

When I browse to different pages, the window title is set to the title of the html page.

How is that done in macgap? I'm looking through the code, and I can't see it anywhere.

I would basically like to turn that functionality off, because it keeps overwriting my custom window title.

Passing arguments or environment variables to an app

I'm going to use MacGap for tiny utilities on the command-line and need a way to pass arguments to the app.

I guess macgap.env is simplest; then I can simply call (probably wrapping it in a shell script):

SOMETHING=foo App.app/Contents/MacOS/App

Toolbar support for the window

The Mac Toolbar window is normally used as Preferences. Currently there is only one window which basically embed an WebView. Would be good introduce another window type with toolbar supported.

The toolbar can be a special HTML element (

), or a separate WebView which basically can render any valid HTML.

Well, I don't know its doable or not, nor the API design.

Flag -url and starter script (optional support for node.js)

Hi, I'm really excited about MacGap and the lightweight direction you are taking. I'd like to discuss 2 feature requests that would allow a MacGap application developer to ship a custom binary (server) and spawn MacGap as child process:

  • ability to optionally configure the startup script (not directly start the .app/Content/MacOS/MacGab binary)
  • support for a "-url" flag, to specify the default location instead of "public/index.html"?

AppStore

Hi
Do you know if there is any app in AppStore made with MacGap? I mean will the apps be approved or they might be rejected for reasons like "private api were used", etc ?

Thank you.

Build instructions

The MacGap.app package included in macgap-rb seems a bit dated (as in: more than a year old). It would be nice to have some build instructions for people who don't have experience with XCode (i.e. me), so they can help themselves.

Drag file upload Support

It would be cool, if it would be possible to drag a file to the app and the webviews receives this file, for example to upload it in an HTML Uploader. This works in safari but not in the app.

Prevent Text Drag?

if something is set to content editable, or shows text cursor on hovering, and you drag, you will drag your webkit past the view of the content. With this issue, you could never actually distribute and app because it would be clear to everyone that it's just an "iframe" webkit view.

I made a movie so you can see the issue. Please advise who i could prevent this?

Movie
http://kizer.me/scrolling-bug.mov

Build for OSX 10.6 and 10.5

MacGap is great and I've chosen to use it in one of my projects. One issue I have, how do I compile it for OSX 10.6 as stated to work in the README.md?

For info, I'm using Xcode 4.5.2 on 10.8.2 with added 10.6 SDK.
I'm not making use of MacGap's ML's full screen or notification options.

Key presses trigger warning sounds

Every time I press a key in my macgap app, it causes the system to play a warning sound (the same one that is played when you try to navigate past the prompt in a terminal).
My DOM does not have anything which is navigable via key presses, but I registered a few key press handlers via JavaScript. Is this a known problem?

So.....

This is like Adobe AIR or Titanium Desktop, except it's Mac-only?

Enable web inspector

There should be a line that you can comment out to enable or disable web inspector, it is very useful for debugging.

Enable external link

Sometime I want to create a link that opens in the browser. I do that by creating a link with target="_blank" but this doesn't work.

Is there anyway to do this?

Thanks!

Error when coming from another page.

1- Create a page that uses macgap.growl
2- Create a location.href to another page (or use a link)
3- CMD + Back Arrow to return
4- This error comes out on the debug console: Trying to access object from destroyed plug-in

Add global keyboard shortcuts (Hotkeys)

It would be great to have a way to add global window shortcuts, for example to add global play/pause to a music application.

Maybe something like:

macgap.menu.addHotKey("cmd-alt-p", function() {
window.App.pauseSound();
});

Window opens in weird position and size

Hey Alex,

Thank you so much for macgap! I am much enjoying playing with it, and starting to design some great apps built on it. However, I have an issue. The main macgap window opens in a sort of "non-standard" position and size, like on the bottom-left corner of my screen, and at a size I do not want. I know I can use JavaScript to resize and reposition the window, but that is very "jerky", as the window appears to "jump" to the new location after it has already opened. This isn't a great user experience.

My question is, can you simply launch the app with the window initially hidden, and then show it once the DOM finishes loading? That would solve all my problems I think.

Or, is there any way for me to configure the initial position and size of the window, possibly with command-line arguments or Info.plist changes?

Thanks again for a great framework!

  • Joe

HTTP Callouts

Does the Same Origin Policy apply for a MacGap webkit window? In other words can I send HTTP requests to multiple endpoints? Regardless, is there an API for making an HTTP callout without using a server proxy?

I The following JQuery function is failing for me:

$.ajax({
type:"GET",
url: "https://www.google.com/",
data: "",
processData: false,
success: function(r) { alert('success') },
failure: function(r) { alert('fail') },
complete: function(r) { $("#main").html(JSON.stringify(r)) }
});
});

Not rendering basic HTML it rendered 1 build ago, but still renders in Safari

Okay I'm using flex boxes. MacGap rendered the entire toolbar and content area fine. It renders fine in Safari (webkit). All of a sudden when rebuilding the test project only the toolbar part of my html renders. It's very strange it stopped rendering at one DOM element in Xcode but renders the first dom element. The exact same page loads fine in webkit. What could cause this, especially if it was rendering fine 30seconds ago?

MacGap:
http://kzr.me/image/062M1O2J371a

Webkit:
http://kzr.me/image/3o2C0a2r1a0v

Localstorage quota in mac app store builds

Running locally I am able to store as much data as I want but I am getting a data quota error when I build a version for the mac app store that stores something that is over 1mb. Here's the error:

QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.

How to get the URL for newly created (or redirected) page?

So like most of the OAuth 2.0 links, like this:

window.open("target-oauth-2.0-url")

// You authorize it
// OAuth server will redirect with special sort of "accee token"
// The webview browser will actually redirect to "your-callback-url?#access_code=newly_created"

Then how do we get the url so that we can parse the access_code for later use?

Flowdock jumps to old messages when switching flows

I've been having a serious problem with Flowdock for weeks now. When I switch flows, Flowdock scrolls back to messages that are sometimes days old. I haven't been able to discern a pattern yet. I completely nuked Flowdock yesterday and reinstalled. I thought it was fixed and chalked it up to something in the betas, but today it's back…

At first I thought it was the last highlight. Then I thought it might be the last place that I jumped to when clicking a notification center popup. I've since found counterexamples for all of these, but yet Flowdock continues to jump back to messages that are anywhere from a few minutes to days old and I have to click on the "Jump to Present" button to get back. This happens every time I switch tabs and it's infuriating.

Out-of-window html rendering

Hey, is there any possible way, to somehow enable out-of-window HTML rendering? For example right now, every html context menu must be positioned inside the main web view window. Which can be limiting sometimes.

Is there any possible way to render HTML content outside of the window as well? Nice example can be Safari extensions...

Unable to restore closed window.

Closing the window (e.g. Command + W) puts the user in a position where it's impossible to bring the window back up (e.g. by click on the app icon in the Doc).

including sqlite for webapp

Hi, I love this! thanks for working on it!

I was able to nicely port my webapp (html5 & js files) using macgap...but sadly it doesn't include/recognize sqlite.

I tried simply including the sqlite3 lib, but no joy.

I'm not real "xcode" savy, and was wondering if you/someone could share how to do this?

Sorry to post here...I wasn't sure were to find help relating macgap and sqlite.

thanks in advance!

ChadStrat

Disable window resizing by the user

Hallo

Is this at all possible? My app is only a certain size and would be annoying if users can break the layout or make it look bad by resizing.

Thanks
Edd

Enable window to be always on top

Some times its handy to have an app remain on top of all other windows.

examples:
For instance, some clock apps, or system monitoring apps are always on top. It would be useful for those creating apps to monitor their server status to have a window that runs on top of their other windows.

Why do the javascript calls only seem to work in the top of the document?

I need to be able to call something like doc badging when i hit a button. It works fine in the head as a script.

But as soon as I put your calls in a jquery function, my alert fires but your javascript returns exceptions. Here's an example. I can't put everything in the head. Where does your javacscript interpreter load?

works in head

macgap.dock.badge = "10";

macgap returns errors if below body tag

    $("button.feed").click(function() { 
      macgap.dock.badge = "10"; // error below
      document.title = 'Stop Clicking AND BE QUIET';  //works
    });

2013-04-19 16:08:57.406 MacGap[8057:303] JavaScript console: undefined:0: TypeError: 'undefined' is not a function

HTML/Javascript Item that can move the app window?

So in my Xcode project I set the titlebar to hidden. This will allow me to use a custom titlebar style at the top, by building it in HTML.

Could you please add javascript to drag app window around?

Screen Shot 2013-04-19 at 3 03 17 PM

Chromes webkit implementation

Is there anyway to use chromes webkit implementation in macgap? It would be awesome since safari doesnt support FileReader yet but chrome does.

Downloading files?

Hi all,

First, great work! I would like to use macgap with an app that needs to download files. The idea is to use the webview cookies to request a file, and save it to the hard disk, but I don't see any function exposed to perform such task. It's possible to do this with the current implementation of macgap?

10.8 notifications

Is anybody having problems with making desktop notifications show up in 10.8?

Growl works but not natives.

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.