Skip to content

ark-srivastav/helpMeDebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•ท๏ธ Shopify Script Debugger

Script injections for CS teams made easier ๐Ÿš€

A powerful Chrome extension designed for Technical Solutions Consultants, developers, and support engineers who need to quickly test, debug, and manage JavaScript code snippets directly in the browser.

Extension Demo Chrome Extension JavaScript React


๐ŸŽฏ Purpose & Vision

๐Ÿค” Why This Extension Exists?

Problem: Technical Solutions Consultants and developers constantly need to:

  • ๐Ÿ” Debug merchant integration issues
  • ๐Ÿ“Š Analyze network logs and console outputs
  • ๐Ÿ› ๏ธ Test JavaScript snippets quickly
  • ๐Ÿ’พ Store and reuse debugging scripts
  • ๐Ÿ”„ Share code snippets across different environments

Solution: A unified debugging companion that lives in your browser!

graph TD
    A[๐Ÿง‘โ€๐Ÿ’ป Developer] --> B[๐Ÿ“ Write JS Code]
    B --> C[โ–ถ๏ธ Execute in Browser]
    C --> D[๐Ÿ“‹ View Console Logs]
    D --> E[๐Ÿ’พ Save for Later]
    E --> F[๐Ÿ”„ Share with Team]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8
    style D fill:#fff3e0
    style E fill:#fce4ec
    style F fill:#f1f8e9
Loading

โœจ Key Features

๐ŸŽจ Smart Code Editor

  • ๐ŸŒ™ Dark Theme - Easy on the eyes during long debugging sessions
  • ๐Ÿ” Syntax Highlighting - JavaScript with full IntelliSense
  • โŒจ๏ธ Keyboard Shortcuts - Ctrl+S to save, Ctrl+Enter to run
  • ๐Ÿ”ง Code Formatting - Auto-format your messy code

๐Ÿ’พ Script Management

  • ๐Ÿ“ Save & Organize - Name and store your frequently used scripts
  • ๐ŸŽฏ Quick Access - Dropdown menu for instant script selection
  • ๐Ÿท๏ธ Smart Naming - Auto-generated names with timestamps
  • โš ๏ธ Unsaved Changes Detection - Never lose your work

๐Ÿ”„ Import/Export System

  • ๐Ÿ“ค Export Scripts - Share your toolbox with teammates
  • ๐Ÿ“ฅ Import Scripts - Load scripts from CSV files
  • ๐ŸŒ Cross-Account Sync - Move your scripts between Chrome profiles
  • ๐Ÿ“‹ Bulk Operations - Select multiple scripts for batch export

๐Ÿ”ง Advanced Execution

  • โšก Instant Execution - Run scripts with one click
  • ๐Ÿ“Š Console Integration - View logs directly in the popup
  • ๐ŸŽฏ Page Context - Scripts run in the actual page environment
  • ๐Ÿงน Auto Cleanup - Prevents script conflicts and memory leaks

๐Ÿš€ How It Works

๐Ÿ“ Architecture Overview

flowchart TB
    subgraph "๐ŸŒ Browser Environment"
        A[๐Ÿ“ฑ Popup UI] 
        B[๐ŸŽฏ Content Script]
        C[โš™๏ธ Background Service]
        D[๐ŸŒ Web Page]
    end
    
    subgraph "๐Ÿ’พ Storage Layer"
        E[๐Ÿ—„๏ธ IndexedDB]
        F[๐Ÿ“ Local Scripts]
    end
    
    A -->|User Input| B
    B -->|Execute Script| C
    C -->|Inject Code| D
    A <-->|Store/Retrieve| E
    E -->|Manage| F
    
    style A fill:#e3f2fd
    style B fill:#f3e5f5
    style C fill:#e8f5e8
    style D fill:#fff8e1
    style E fill:#fce4ec
    style F fill:#f1f8e9
Loading

โšก Execution Flow

sequenceDiagram
    participant ๐Ÿ‘ค User
    participant ๐ŸŽจ Popup
    participant ๐Ÿ“ก Background
    participant ๐ŸŒ WebPage
    
    ๐Ÿ‘ค User->>๐ŸŽจ Popup: Write JavaScript Code
    ๐Ÿ‘ค User->>๐ŸŽจ Popup: Click "Run Script"
    ๐ŸŽจ Popup->>๐Ÿ“ก Background: Send Script Content
    ๐Ÿ“ก Background->>๐ŸŒ WebPage: Inject & Execute
    ๐ŸŒ WebPage->>๐Ÿ“ก Background: Return Results & Logs
    ๐Ÿ“ก Background->>๐ŸŽจ Popup: Display Console Output
    ๐ŸŽจ Popup->>๐Ÿ‘ค User: Show Execution Results
Loading

๐ŸŽฎ User Guide

๐Ÿ Getting Started

  1. ๐Ÿ“ฅ Install Extension

    # Clone the repository
    git clone https://github.com/your-repo/shopify-script-debugger
    cd shopify-script-debugger
    
    # Install dependencies
    npm install
    
    # Build the extension
    npm run build
  2. ๐Ÿ”ง Load in Chrome

    • Open chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the extension folder
  3. ๐ŸŽฏ Pin Extension

    • Click the puzzle piece icon in Chrome toolbar
    • Pin "Shopify Script Debugger" for easy access

๐Ÿ’ก Basic Usage

โœ๏ธ Writing Your First Script

// ๐ŸŽฏ Example: Check if jQuery is loaded
if (typeof $ !== 'undefined') {
    console.log('โœ… jQuery is loaded!', $.fn.jquery);
} else {
    console.log('โŒ jQuery not found');
}

// ๐Ÿ” Example: Debug Shopify cart
if (typeof Shopify !== 'undefined') {
    console.log('๐Ÿ›’ Cart contents:', Shopify.cart);
} else {
    console.log('๐Ÿšซ Not a Shopify store');
}

๐Ÿ’พ Saving Scripts

  1. Write your code in the editor
  2. Press Ctrl+S or click "Save"
  3. Give your script a meaningful name
  4. Access it anytime from the dropdown! ๐ŸŽ‰

๐Ÿ”„ Managing Your Script Library

graph LR
    A[๐Ÿ“ New Script] --> B{๐Ÿ’พ Save?}
    B -->|Yes| C[๐Ÿท๏ธ Name Script]
    B -->|No| D[โš ๏ธ Unsaved Changes]
    C --> E[๐Ÿ“š Script Library]
    E --> F[๐Ÿ“ค Export]
    E --> G[๐Ÿ—‘๏ธ Delete]
    E --> H[โœ๏ธ Edit]
    
    style A fill:#e8f5e8
    style C fill:#e3f2fd
    style E fill:#f3e5f5
    style F fill:#fff3e0
Loading

๐Ÿ› ๏ธ Technical Implementation

๐Ÿ—๏ธ Project Structure

๐Ÿ“ฆ shopify-script-debugger/
โ”œโ”€โ”€ ๐Ÿ“„ manifest.json              # Extension configuration
โ”œโ”€โ”€ ๐Ÿ“ popup/                     # React-based UI
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŽจ components/        # React components
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”ง hooks/            # Custom React hooks  
โ”‚   โ”‚   โ””โ”€โ”€ ๐ŸŽฏ utils/            # Utility functions
โ”‚   โ””โ”€โ”€ ๐Ÿ“ build/                # Compiled popup
โ”œโ”€โ”€ ๐Ÿ“ scripts/                   # Extension scripts
โ”‚   โ”œโ”€โ”€ โš™๏ธ background.js         # Service worker
โ”‚   โ”œโ”€โ”€ ๐ŸŽฏ contentScript.js      # Page injection
โ”‚   โ””โ”€โ”€ ๐Ÿ’พ storageService.js     # IndexedDB operations
โ””โ”€โ”€ ๐Ÿ“ icons/                     # Extension icons

๐Ÿ”ง Core Technologies

  • ๐ŸŽจ Frontend: React 18 + Tailwind CSS
  • ๐Ÿ“ Code Editor: CodeMirror 6 with JavaScript syntax highlighting
  • ๐Ÿ’พ Storage: IndexedDB for local script persistence
  • ๐Ÿ—๏ธ Build: Webpack + Babel for modern JavaScript
  • ๐ŸŽฏ Extension APIs: Chrome Extensions Manifest V3

๐Ÿ’พ Data Flow & Storage

erDiagram
    SCRIPT {
        string id PK
        string name
        text content
        number lastModified
        string description
    }
    
    USER ||--o{ SCRIPT : creates
    SCRIPT ||--o{ EXECUTION : runs
    
    EXECUTION {
        string scriptId FK
        timestamp executedAt
        text logs
        boolean success
    }
Loading

๐ŸŽฏ Use Cases

๐Ÿ‘จโ€๐Ÿ’ผ For Technical Solutions Consultants

// ๐Ÿ” Debug Shopify theme issues
const themeInfo = {
    name: Shopify.theme.name,
    id: Shopify.theme.id,
    role: Shopify.theme.role
};
console.log('๐ŸŽจ Current theme:', themeInfo);

// ๐Ÿ“Š Check installed apps
const apps = Array.from(document.querySelectorAll('script[src*="app"]'))
    .map(script => script.src);
console.log('๐Ÿ“ฑ Detected apps:', apps);

๐Ÿง‘โ€๐Ÿ’ป For Frontend Developers

// โšก Performance monitoring
const perfData = {
    loadTime: performance.timing.loadEventEnd - performance.timing.navigationStart,
    domReady: performance.timing.domContentLoadedEventEnd - performance.timing.navigationStart,
    resourceCount: performance.getEntriesByType('resource').length
};
console.log('๐Ÿ“ˆ Performance metrics:', perfData);

๐Ÿ”ง For QA Engineers

// ๐Ÿงช Form validation testing
const forms = document.querySelectorAll('form');
forms.forEach((form, index) => {
    console.log(`๐Ÿ“ Form ${index + 1}:`, {
        action: form.action,
        method: form.method,
        fields: form.querySelectorAll('input, select, textarea').length
    });
});

๐Ÿ”ฎ Roadmap & Future Features

๐ŸŽฏ Planned Features

  • ๐ŸŒ Cloud Sync - Sync scripts across devices
  • ๐Ÿค Team Sharing - Share script collections with teammates
  • ๐Ÿ“Š Analytics Dashboard - Track script usage and performance
  • ๐Ÿ”— API Integration - Connect with external debugging tools
  • ๐ŸŽจ Custom Themes - Personalize the editor appearance
  • ๐Ÿ”„ Version Control - Track script changes over time
  • ๐Ÿค– AI Suggestions - Smart code completion and debugging hints

๐Ÿš€ Version History

timeline
    title ๐Ÿ“… Development Timeline
    
    section ๐Ÿ’ก Ideation
        Q1 2024 : Initial concept
                : Market research
    
    section ๐Ÿ—๏ธ Development  
        Q2 2024 : MVP development
                : Core features
                
    section ๐Ÿงช Testing
        Q3 2024 : Beta testing
                : User feedback
                
    section ๐Ÿš€ Release
        Q4 2024 : Public release
                : Feature expansion
Loading

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

๐Ÿ› Found a Bug?

  1. ๐Ÿ” Check existing issues
  2. ๐Ÿ“ Create detailed bug report
  3. ๐Ÿท๏ธ Include steps to reproduce

๐Ÿ’ก Have an Idea?

  1. ๐Ÿ’ญ Discuss in GitHub Discussions
  2. ๐Ÿ“‹ Create feature request
  3. ๐Ÿ—ณ๏ธ Get community feedback

๐Ÿ‘จโ€๐Ÿ’ป Want to Code?

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create feature branch
  3. โœ… Write tests
  4. ๐Ÿ“ค Submit pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • ๐ŸŽจ CodeMirror - For the amazing code editor
  • โš›๏ธ React Team - For the robust UI framework
  • ๐ŸŽฏ Chrome Extensions Team - For the powerful platform
  • ๐Ÿ›๏ธ Shopify Community - For inspiration and use cases

๐Ÿ“ž Support & Contact


โญ Star this repository if it helped you! โญ

Made with โค๏ธ for the developer community

About

Script injections for CS team made easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages