Extensions Tutorial
Follow through this tutorial to get a good overview of what extensions can do.
The finished tutorial is included with the extension kit. If you get stuck and something doesn't work, check the finished tutorial to see what is different.
Create Extension
To create a new extension run the command:
You are prompted for a name, and then the new extension is created for you in src
.
Build/Install Extension
To build your extension run the command:
New extension are set to install automatically. If you have Bike running then after building your new extension is loaded into Bike.
Debug Extension
There are two important sources for debugging your extension.
Logging
First use the Bike's logs explorer to see logging.
To view the log explorer:
Select the menu Bike > Window > Logs Explorer
Do that now and you should see logs that your extension is installed and activated. You will also see a notice originating from your extensions call to console.log
in the activate function.
Safari Debugger
For more complex debugging tasks use Safari's debugger. This allows you to step line by line over your extension code and inspect variables.
To enable Safari's debugger:
Go to Safari > Settings > Advanced and check "Show features for web developers".
Go to Safari > Develop > Inspect Apps and Devices to see active contexts
Start Bike 2 and it should show in the Safari window from previous step.
In that window it will show all of Bike's Javascript contexts. Click on a context to open the debugger for that context. Then you can set breakpoints, examine variables, etc.
Next Steps
Follow these tutorials to learn how to use each context:
Last updated