processing / processing/p5.js-web-editor

print function opens up print webpage popup

Open
#3,678 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Ready for Work
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

p5.js version

2.0.5

What is your operating system?

Mac OS

Web browser and version

Google Chrome 140.0.7339.208 (Official Build) (arm64)

Actual Behavior

Using print function to print variables open up the print webpage popup instead of printing in the console.

screenshot for reference:

It happens only when the print function is written without any arguments and the auto-refresh is kept on.

Image

On typing some variable afterwards it correctly prints the variable in the consiole without the above issue.

Image
Expected Behavior

Expecting the code to not open the print popup.

It should either throw some error saying print can't be called with no arguments or should not print anything to console and let the user figure out the error.

Steps to reproduce
Steps:
  1. paste the below code.
  2. run the code and you will see that the print popup shows up
Snippet:
function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
  print()
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided sketch in the p5.js Web Editor with auto-refresh enabled, using Chrome on macOS. Trace how a zero-argument print() call is handled and confirm that the completed fix no longer opens the browser print popup while preserving normal variable output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.