Title: Firefox content script does not allow clearTimeout and clearInterval to be called in a non-global context · Issue #37333 · angular/angular · GitHub
Open Graph Title: Firefox content script does not allow clearTimeout and clearInterval to be called in a non-global context · Issue #37333 · angular/angular
X Title: Firefox content script does not allow clearTimeout and clearInterval to be called in a non-global context · Issue #37333 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? No Description A clear and concise description of the problem... When calling clearInterval or clearTimeout in the restricted context of ...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? No Description A clear and concise description of the problem... When calling clearInterval or cl...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? No Description A clear and concise description of the problem... When calling clearInterval or cl...
Opengraph URL: https://github.com/angular/angular/issues/37333
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Firefox content script does not allow clearTimeout and clearInterval to be called in a non-global context","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\nThe issue is caused by package @angular/zone.js\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\nNo\r\n\r\n### Description\r\n\r\n\u003c!-- ✍️--> A clear and concise description of the problem...\r\nWhen calling `clearInterval` or `clearTimeout` in the restricted context of a content script on Firefox with ZoneJS initialized, the call will error out because the function is no longer being called in the context of the `window`.\r\n\r\n## 🔬 Minimal Reproduction\r\nDifficult to recreate, I'll update my previous testing repo later today.\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nERROR TypeError: \"'clearInterval' called on an object that does not implement interface Window.\"\r\n\u003c/code>\u003c/pre>\r\n\u003cimg width=\"205\" alt=\"image\" src=\"https://user-images.githubusercontent.com/715484/83179116-852a6f00-a0ef-11ea-870b-04b41dc1ecbf.png\">\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\n\u003c!-- run `ng version` and paste output below -->Angular CLI: 9.1.1\r\nNode: 12.16.3\r\nOS: darwin x64\r\n\r\nAngular: 9.1.1\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.901.1\r\n@angular-devkit/build-angular 0.901.1\r\n@angular-devkit/build-optimizer 0.901.1\r\n@angular-devkit/build-webpack 0.901.1\r\n@angular-devkit/core 9.1.1\r\n@angular-devkit/schematics 9.1.1\r\n@angular/cdk 9.2.1\r\n@ngtools/webpack 9.1.1\r\n@schematics/angular 9.1.1\r\n@schematics/update 0.901.1\r\nrxjs 6.5.5\r\ntypescript 3.8.3\r\nwebpack 4.42.0\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->\r\nThis applies only to Firefox Web Extension content scripts, a temporary patch to work around this issue is below, placed after the zone.js import in `polyfills.ts`:\r\n```typescript\r\nconst patchedClearTimeout = window.clearTimeout;\r\nwindow.clearTimeout = function(...args) {\r\n return patchedClearTimeout.apply(window, args);\r\n};\r\n\r\nconst patchedClearInterval = window.clearInterval;\r\nwindow.clearInterval = function(...args) {\r\n return patchedClearInterval.apply(window, args);\r\n};\r\n```\r\n\r\n\u003c!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->\r\n","author":{"url":"https://github.com/spaceribs","@type":"Person","name":"spaceribs"},"datePublished":"2020-05-28T18:30:55Z","url":"https://github.com/angular/angular/issues/37333"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e01fa803-8863-883e-def2-760111e94b7b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5BC:31E99C:1CA5E32:2631027:6B0165B3 |
| html-safe-nonce | 6737fa923ce94926666196a3feef04350d87a63dc1a95c3515d2bee0d2588678 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUJDOjMxRTk5QzoxQ0E1RTMyOjI2MzEwMjc6NkIwMTY1QjMiLCJ2aXNpdG9yX2lkIjoiNTI3OTk4NDkxNTc1NTEzMjMzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 76d82e75f8bb63799a2dea33ade3190e17b590e4c695ed5a83e0828b603ad387 |
| hovercard-subject-tag | issue:626722264 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/37333/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b062dd7a9e4657776ea8ba7f46309c23f02b3df24972128fb049928b73d9bac9/angular/angular/issues/37333 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b062dd7a9e4657776ea8ba7f46309c23f02b3df24972128fb049928b73d9bac9/angular/angular/issues/37333 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/zone.js Is this a regression? No Description A clear and concise description of the problem... When calling clearInterval or cl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | spaceribs |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width