Skip to content

Comments

Add Masyu Solver Chrome Extension (WASM/Python)#73

Draft
google-labs-jules[bot] wants to merge 3 commits intodevelopfrom
feature/masyu-wasm-solver-246911397604775007
Draft

Add Masyu Solver Chrome Extension (WASM/Python)#73
google-labs-jules[bot] wants to merge 3 commits intodevelopfrom
feature/masyu-wasm-solver-246911397604775007

Conversation

@google-labs-jules
Copy link
Contributor

This PR adds a Chrome Extension to solve Masyu puzzles on gridpuzzle.com.
The extension leverages WebAssembly (WASM) via Pyodide to run a custom Python solver directly in the browser.

Key changes:

  • Solver: Ported Masyu logic to a pure Python implementation (solver_logic.py) using constraint propagation and backtracking, as ortools is not compatible with standard Pyodide distributions.
  • Extension Architecture:
    • Popup: Initializes Pyodide, fetches the Python solver script, and handles user interaction.
    • Content Script: Scrapes the puzzle grid from the page's gpl variables and simulates clicks on the canvas to apply the solution.
    • Manifest V3: Configured with necessary permissions (activeTab, scripting, wasm-unsafe-eval).

Note: The original MasyuSolver (using OR-Tools) was preserved in the main codebase, while the extension uses the lightweight solver_logic.py.


PR created automatically by Jules for task 246911397604775007 started by @newtomsoft

- Created `ChromeExtensions/Masyu/` structure.
- Implemented `solver_logic.py` as a pure Python solver (Constraint Propagation + Backtracking) to replace the OR-Tools based solver for browser compatibility.
- Added `manifest.json`, `popup.html`, `popup.js`, and `content.js`.
- Configured Pyodide to load and run the solver in the extension popup.
- Added scraping logic to `content.js` based on `GridPuzzleMasyuGridProvider`.
- Added logic to apply the solution to the canvas grid.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link

github-actions bot commented Dec 25, 2025

Qodana Community for Python

126 new problems were found

Inspection name Severity Problems
Missing await syntax in coroutine calls 🔶 Warning 36
Redeclared names without usages 🔶 Warning 20
Unused imports 🔶 Warning 19
Invalid type hints definitions and usages 🔶 Warning 8
Unbound local variables 🔶 Warning 5
Unused local symbols ◽️ Notice 20
Shadowing names from outer scopes ◽️ Notice 8
Method is not declared static ◽️ Notice 5
An instance attribute is defined outside init`` ◽️ Notice 2
Unclear exception clauses ◽️ Notice 2
Invalid abstract class definition and usages ◽️ Notice 1

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

- Created `ChromeExtensions/Masyu/` structure.
- Implemented `solver_logic.py` as a pure Python solver (Constraint Propagation + Backtracking) to replace the OR-Tools based solver for browser compatibility.
- Added `manifest.json`, `popup.html`, `popup.js`, and `content.js`.
- Downloaded and bundled Pyodide locally in `ChromeExtensions/Masyu/lib/` to comply with Manifest V3 CSP.
- Configured Pyodide to load from local resources in `popup.js`.
- Added scraping logic to `content.js` based on `GridPuzzleMasyuGridProvider`.
- Added logic to apply the solution to the canvas grid.
- Created `ChromeExtensions/Masyu/` structure.
- Implemented `solver_logic.py` as a pure Python solver (Constraint Propagation + Backtracking) to replace the OR-Tools based solver for browser compatibility.
- Added `manifest.json`, `popup.html`, `popup.js`, and `content.js`.
- Downloaded and bundled Pyodide locally in `ChromeExtensions/Masyu/lib/` to comply with Manifest V3 CSP.
- Configured Pyodide to load from local resources in `popup.js`.
- Added scraping logic to `content.js` based on `GridPuzzleMasyuGridProvider`.
- Added logic to apply the solution to the canvas grid.
- Generated a valid 16x16 PNG for `icon.png` to fix manifest loading error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants