Wiki

Clone wiki

BibSonomy Browser Buttons Extensions / Home

Overview

The BibSonomy Browser Extension, known as "BibSonomy Buttons," enhances browser interaction with BibSonomy. It enables users to access their profiles, add bookmarks, and publications directly through the browser.

Development and Building Process

Building the Extension

The BibSonomy Browser Extension supports custom builds for BibSonomy,Biblicious, Puma, and Wue Research. To accommodate these variants, a specialized build script, build_extensions.pl, is used.

Building Steps

  • Execute build_extensions.pl in the project's root folder. This script assembles the extension and places it in the build folder, ready for browser integration.
  • Specify the properties file and the target browser (chrome, firefox, or safari) as arguments in the script. Keep in mind that building for Safari is only possible on Macs with Xcode installed and configured.

Example Command

perl build_extensions.pl bibsonomy.properties chrome

Post-Build

Upon completion, the build script generates a zip file in the build directory. Navigate to build > instance_name > browser_type to locate the browser_type.zip file, which can be unpacked and loaded as an unpacked extension in the corresponding browser.

For Safari Builds: Since Apple, of course, wants you to add some special sauce, you will need to finish the build process in XCode. The project should open automatically after running the script. After that you can use XCode as normal to export the Plugin for the different platforms.

Developing in VS Code

VS Code is a useful tool for working on the BibSonomy Browser Extension. Here's how to set it up for easier development and testing:

Loading the Unpacked Extension in Chrome

After building the extension, you can load it into Chrome to test it:

  1. Go to chrome://extensions/ in Chrome.
  2. Turn on "Developer mode".
  3. Click "Load unpacked" and select your extension's folder from build/instance_name/chrome.
  4. The extension will now be in your Chrome extensions list for testing.

Auto-Building with Run on Save

To make development faster, you can use the "Run on Save" extension in VS Code to automatically build the extension every time you save a file. Here's how:

  1. Install "Run on Save" in VS Code from the marketplace.
  2. In your project, open or create .vscode/settings.json and add this:
{
    "emeraldwalk.runonsave": {
        "commands": [
            {
                "match": ".*\\.*$",
                "cmd": "perl build_extensions.pl bibsonomy.properties chrome"
            }
        ]
    }
}

This setup rebuilds the extension with every save, making it easy to test changes quickly.

Properties File Structure

The properties file should include:

# Essential Information
project.name = ...
project.home = ... # Include trailing slash.

# Optional Settings
project.listUrl = ... # JSON list of valid BibSonomy instances.
project.iconPath = ... # Icon directory path, relative to project root.

Directory Layout and File Details

Root Directory

  • misc: Store-related assets and metadata for extension listings.
  • src: Primary source files for the extension.
  • build: Compiled extension files post-build.
  • build_extension.pl: Script for the building process.
  • Property Files: Specific configurations for BibSonomy, Puma, and Wue Research.

Source Directory (src)

  • extension: Shared base files for all BibSonomy instances.
  • misc: Custom files for PUMA and WueResearch, merged with base files during building.

Extension Files in src/extension

  • locales: Language translations.
  • css: Styling files.
  • images: Default and customizable icons.
  • scripts:
  • background.js - Background operations script.
  • popup.js - Popup UI script.
  • misc.js - PUMA-specific scripts.
  • ui: UI HTML components.
  • manifest.json: Extension metadata configuration.

Updated